I agree in principle, and I understand how this sort of thing happens but the problem here seems to be the phrasing.
‘I won’t accept sexist comments’ (when none have been made yet) pre-judges the students in front of her and could be seen to be antagonistic. Some students may even, unfortunately, view that as a challenge, perceiving a worry about that specific behaviour and then rising to it.
vs
’Respect is very important in my classroom and I expect students to show respect to me and one another.’
As the OP is concerned about sexist comments, she could even discuss some examples of respect linked to behaviours, but keep it depersonalised and a bit more general.
’One example of being respectful is following my instructions. Another is being quiet when a classmate is contributing. Another is that we treat one another equally and fairly regardless of any differences between us.’
Even better, ‘we’ statements - suggests that everyone is on the same side and depersonalises at a stage where things haven’t yet gone wrong. ‘In this school/in my class, we treat one another with respect…’ etc.
If things do go wrong, then the teacher refers back to the above expectations and has grounds to become more specific, e.g. ‘Remember, respect is very important in my classroom and that comment was disrespectful because it was sexist’.
@ForSillyGreySwan I would normally expect a head of department to pick this up with you and give you some advice, ideally not by putting in a meeting that you would worry about overnight, but just finding a time to address it. Unless you’re in a very small school, with no other real leadership positions, this doesn’t seem like a principal-level issue to me. Lots of teachers get this sort of thing slightly wrong early in their careers.