I completely agree that your DD did nothing wrong at all but aside from any trans stuff, I'm surprised at how many people are saying how impossible it is to mis-sex someone.
There have definitely been times I've not known if someone is biologically a man or woman. Rarely but it's happened.
I wonder if this teacher isn't trans and they're just a very masculine looking woman?
Did nobody else in the class make the same mistake? When it happened did nobody express surprise that they all should have been using "miss"? Did other kids laugh at DD? Say anything?
The two possibilities are:
1.) If DD is positive that it was obviously a biological man and he just expects them to know to use "miss" without mentioning it then that teacher is bonkers.
2.) If it's a mannish looking woman then DD just got it wrong and went with what she thought. It happens and wasn't malicious.
Either way she's done nothing wrong and if any punishment appears I would be right in the school.
OPs daughter, if you're reading this, these are some of the things that pupils said to me when I was a teacher:
1.) You have hair on your lip like a moustache.
2.) Why is your belly so big? Is there a baby in there (no)
3.) Why can't we have the supply teacher back? They taught us things.
4.) Miss why is learning so boring this year?
5.) Miss your story is rubbish.
Etc etc.
I could write a list hundreds long. I'm sure all teachers could. Being a teacher with a thin skin isn't going to work well.
Whatever happened here, I can promise you that "sir" was nowhere near the worst thing that's been said to them in their career. Or this year. Or even perhaps this week. Their reaction was completely disproportionate and sounds like their issue instead of yours.