After demonstrating to their offspring that God is the Author and Finisher of their lives. After all of this, the children of the most Godly parents sometimes go astray. Not only do the parents blame themselves, they also sometimes come under the scrutiny of their peers. And yet, God is the God of the second chance. It's their fault.
Sin is a choice .
The choice of the person who has the decision to make. I can't make the choices for my children. I can teach them how to make good choices, but the choices they make are their's alone, right or wrong. God understands about children going astray. He's been in the parenting business for a long time, and sometimes even His children wander off into the desert of rebellion.