It didn’t change genders it was genderless before. It says a young dragons gender is determined by someone’s strong influence over them (in this case basically their first love, even if they don’t realize it yet) they don’t just go swapping genders left and right, once it’s set that’s what they are
the fact that the dragon changed genders just cause they felt the need to make it heterosexual kinda pisses me off a little