When a Baleful Polymorph causes characters to get transformed into another sex though, it's almost always male characters getting stuck with female bodies — in other words, trans men.
(Which is why in nearly all countries, a birth certificate will now say "sex" instead of gender, leaving it up to the individual to find out instead.) Gender falls on a big gradient — some people are strictly male or female, and others have aspects of both, or are neither.
Some transgender people have dysphoria on physical or social levels, and pursue medical means (e.g.
Since medical science has only been able to alleviate dysphoria for about a century, the vast majority of transgender people in history did not have the option to change their bodies, and many today still don't have access to medical transitioning options.
Transgender people aren't a new group; their existence has been documented as far back as the Roman Empire, but they're often disadvantaged or discriminated against in their respective societies, which clouds their visibility throughout history.
They're often used as a source of interesting Conflict in a story, partly because their coming-out stories can depict change more visually.