You know, this kinda reminds me of a trope I always disliked about GB manga in general, is the hair suddenly growing or shrinking (depending on if they turned into a girl or guy) as if a random disease or surgery or science thing etc understands gendered social expectations for appearance.
Women having long hair and men having short hair is an old fashioned social construct that, while still generally how most people of whichever gender like wearing their hair, isn't an inherent biological fact.
Of course, I make exceptions to this for situations like magic that can change your appearance completely, but if going for a more science or illness related explanation, it doesn't make a whole lot of sense.