I know children have free will, and that children apostatize even from good families. But you can increase your chances by doing a good job as parents, and being prudent.
My theory is that this phenomenon of "out of the blue apostasy" doesn't happen nearly as often as you might think.
For example, take these 2 Trad families. I knew both of them personally. Let's call them the Alphas and the Betas.
Mr. Alpha had a large Catholic family, and went to a Trad chapel every Sunday with his wife and children. But he also fell for Bishop Fellay's line of bull that we need to "get back in Rome" lest we all end up Schismatic. Also, one or more of his daughters started wearing scandalously short skirts, and started to run into trouble with fellow Trad parishioners. So for these two reasons (the SSPX slide towards the Indult, and his daughters getting criticized for how they were dressing) he took his whole family to the local Indult Tridentine Mass.
Mrs. Alpha likes this move, because she's all about socializing. She wouldn't like the Resistance, because there are less mothers there to socialize with.
Now they live in an Indult milieu, where short skirts aren't a problem. Let's face it -- you are going to find more worldly people at an Indult chapel than you would at a more serious Trad chapel.
Point #1: If Mr. & Mrs. Alpha suffer any of their children becoming apostates, can we really say, "Oh, what a shame! It was totally outside their control!"
I wouldn't.
On to the next example --
Mr. and Mrs. Beta are another Trad Catholic family. They have been Trad for decades. But this family has a different problem -- discipline. The children receive almost no discipline, at least before age 6 or 7. The parents don't agree on discipline, so the children all become master manipulators. By the time Mr. Beta is forced to start attempting some form of discipline, it's too late -- and half-hearted attempts are made at excessive spanking to make up for it. Empty threats, irregular enforcement -- all the usual parental mistakes when it comes to discipline. Even Mr. Beta has a real soft spot for TV and other material things, and his kids pick up on this. They crave smartphones, TV, movies, the beach, and all manner of worldly things. The parents are very strict in various ways, but they certainly fail to teach their children the WHY of Catholic morality and living. They are more about threats and appeals to authority. And, again, Mr. Beta probably causes more resentment than anything else. Imagine being a child raised from an early age to do whatever you want, then all the sudden you get beat for doing something "wrong". You'd feel it was unfair, and you'd be right.
Point #2: If any of these "Beta" children became apostates, could you really say, "Oh man, what a shame! That could happen to anyone! They were all raised Trad Catholic and everything!"
No, because a wise man knows that if you fail to teach MORTIFICATION, they will likely fall into sins of impurity which enslaves the Will, darkens the Intellect, and leads to apostasy. It's a simple pattern that you can observe happening millions of times over in the world.