Fools think their own way is right - Proverbs 12:15
David advised Solomon to observe the requirements of the Lord and follow all his ways - 1 Kings 2:3-4
Solomon may have spoken words of wisdom but his life ended in foolishness:
Solomon's failure to practice what he preached led to his downfall
His wives turned his heart away from God and toward idol worship
You will save yourself a lot of trouble by knowing the Word of God and doing what is says