That lets the teacher off the hook because the relationship was consensual.
If a student can claim to be the gender other than their own, they can claim to be another age.
"I'm not 14, I identify as 41."
"Mommy, I wanna be a snake. Can I cut off my arms and legs?"
"No."
"Why not?"
"Because you're five and that's harmful."
"Mommy, I wanna be like Ernie from Sesame Street. Can I cut off one finger on each hand?"
"No."
"Why not?"
"Because you're five and that's harmful."
"Mommy, I wanna be a girl. Can I cut off my penis?"
"Sure. You know what's best. Mommy will sue the doctors if they won't do it."