Exodus 2:22, Gershom. Gershom’s sons eventually became idol worshipers inspire of their illustrious and righteous grandfather (Judg 18:30–31).
Many of the children of righteous men in the Bible didn’t follow in the footsteps of their fathers in remaining faithful to Elohim. Examples include Isaac (Esau), Aaron (Nadab and Abihu), Samuel (1 Sam 8:1–3), and David and many of the other righteous kings of Judah. What’s more, the Bible tells us nothing about the spiritual status of the sons of any of the prophets or apostles. Whether they remained faithful to YHVH or not, we don’t know. If they had been notable in their service to YHVH, it seems that Scripture would have some record of it.
One things seems certain. Most of the high visibility servants of YHVH were solitary figures. Little if anything is mentioned about their spouses, families or children who seemed to play no major role in the key figure’s ministry activities.
Interestingly, there are also several examples of righteous sons coming from unrighteous fathers and vice versa. This is the case with several of the kings of Judah.
All this is to say that just because a child was raised well in a godly family doesn’t guarantee they will continue to serve Elohim and walk in righteousness.
Likewise, just because a child was raised in an ungodly, even wicked family, doesn’t mean they will be wicked and ungodly.
Salvation is an individual matter. YHVH calls and chooses whom he will, and it’s up to the individual to respond to that calling. So will respond, most will not. As Yeshua said, many are called, but few are chosen (Matt 22:14).