Sex is anatomical difference based on reproductive organs. Gender is the social notions we build around those differences . Sex has remained unchanged though humans, and in fact across mammals. Gender changes like the wind, with lots of different models. Sex is natural, essential, enduring.
Gender is social, constructed, ephemeral.
Their sex didn't change, but the manifestations of their gender sure did. That's why males are males, but men are made. Sex is biology. Gender is the choices we assign based on biology. Woman born male is someone making the choices of a woman born with a male sex.