It's not just a random plant that turned Hermie. They take thousands of em.. Cull the Males. Select the best 50 Females, then attempt to 'shock' the plants through various tests such as low/high temps, high PH/EC, hot/cold feeds, erratic light cycles etc. All the while throwing away the weaker plants that Hermied along the way.
When they are left with a few (or one) genetically strong unique pheno they then force it to change through the use of a chemical called Collodial Silver. This makes the female produce pollen and thus it pollenates itself with Female Pollen (leaving no Male chromosone in the equation). Sure the offspring could hermie as a result, but if u get ur seeds from a quality place then u can b assured that their rigorous testing has more than 99% ruled that possibility out.