There are many factors of stress. Air problems, cutting/training, nutrient problems, soil problems, ph problems, light problems....
If you stress the unsexed plant good enough in vegging stage it can turn directly to male (Even if its a feminized).
If you stress the plant good enough in flowering stage it can turn to hermie.