I once worked at a company where a woman programmer quit, and also many of the men weren’t too happy either. It was a fairly confrontational place, where whoever shouted the loudest at a meeting would get their way.
I’ve also had a number of horrible managers, whose nastiness went unchecked, and it was apparent that it went to the top. As a friend of mine says, “the fish first stinks from the head”.
So, I am not surprised, but am sad, that women leave engineering. I have two daughters who have fine minds, and I know it will be harder for them to find a good organisation to work for than my son.