As others have said, if it was not stress induced then it in genetics.
If you let the hermie pollinate your females, the seeds from the pollinated females will be feminized seeds.
If it's in the genetics, the seeds will carry the hermie trait but the first generation will have a low chance of being hermie.
If you see the nanners early on, they can be picked off the plant before they pollinate others so you don't have to kill the whole plant.