One of the local stories I heard was about a PE teacher who knocked on the girls' changing room and told them that whatever activities they were doing are starting. He didn't enter, just wanted to get their attention and shouted this through the door. Someone got scared by that, reported that he wanted to enter the changing room and that resulted in lost job - not sure if he was reported anywhere higher in that specific case. (it was mentioned in discussion between coaches, because the local club had changing rooms that had to be used)
Would the same thing happen if it was a female teacher? Probably not. Would it happen with female teacher and boys' changing room? I'd say highly unlikely.