I think it will depend on how they define "misogyny" and "woman". If the law is clear that the offense is based on sex and not gender, I don't see the problem with protecting trans women who are attacked bc the attacker thinks he's a natal woman. That's what most laws dealing with discrimination or prejudice say. If someone denies me a job bc they think I'm Jewish, it's antisemitism even if I'm not. If they won't rent to me bc they think I'm disabled, it's a violation even if I don't have whatever disability they think I have.
E.g., based on Scotland's Offence of racially aggravated harassment, the statute might read:
A person commits an offence if the person—
(a)pursues a[n] racially aggravated course of conduct which amounts to harassment of another person on account of misogyny and—
(i)is intended to amount to harassment of that person, or
(ii)occurs in circumstances where it would appear to a reasonable person that it would amount to harassment of that person, or
(b) acts in a manner which is raciallyaggravated by misogyny and which causes, or is intended to cause, another person alarm or distress.
(2)A course of conduct or an action is racially aggravated by misogyny if—
(a)at the time of carrying out the course of conduct or action, or immediately before or after doing so—
(i)the offender demonstrates malice and ill-will towards the victim, and
(ii)the malice and ill-will is based on the victim's membership or presumed membership of a group defined by reference to the female sex, or
(b)the course of conduct or action is motivated (wholly or partly) by malice and ill-will towards a group of persons based on the group being defined by reference to race, colour, nationality (including citizenship), or ethnic or national origins the female sex.
Misogyny should be defined as malice or ill will based on membership in the female sex class, not gender.
This would make it clear that it doesn't apply to someone calling a trans woman a man bc they clearly don't think that the transwoman is a member of the female sex class. It wouldn't apply if someone harassed a trans woman bc he was trans or not a woman (though laws that prohibit discrimination bc of trans status might).