Verse 6 is a verse that has caused both encouragement and discouragement to many parents over the years. It is an encouragement to train our children in God's ways and God's Word. It an encouragement that setting a spiritual foundation at a young age will set a course towards a relationship with God for life. It is a wise thing to teach your kids the ways of God.
It has been discouragement for some people whose children walk away from the LORD. The reason it is discouraging is because they assume they failed as parents because their children do not walk with Jesus as adults. They think they must have not done a good job because if they had just done better then their kids would still have faith. They may even blame God because they did what they were supposed to do but He did not keep them on the right path. We get discouraged because we turn a Proverb into a promise. God did not promise that if we set them on the right path of faith that they would never depart from it. This is a Proverb that gives us wisdom of what the best approach is and more often than not this carries itself out to be true. God gave our kids freewill and eventually they have to choose to follow Jesus on their own. The goal of raising Christian kids is not merely to get them to behave the right way, but the goal must be ultimately to get them to love God. You can get your kids to behave like Christians, but more than anything you must teach them how to truly love Christ.
Solomon's own son Rehoboam who took the throne after Solomon became prideful and arrogant and allowed idol worship to become prevalent in Israel. In fact, it was Rehoboam who reigned when the nation split in two- Judah and Israel became separate kingdoms. So, the Proverb of Solomon did not even come to full fruition in his own son. If there were things you did wrong as parents, then own them and seek forgiveness. If your kids walked away despite your best godly efforts then continue to pray for your kids, but don't feel like you failed as a parent. Even Jesus had someone who spent years with him as follower who never really believed in Him as the Savior- Judas was present and did the right things but never really believed and eventually walked away from Jesus for 30 pieces of silver.