Were human (5e Disease)
From D&D Wiki
Were Human is an advanced or specialist variant either of gender dysphoria/intersex in a magical rich universe [non infectious] or a specialized variant of lycanthrope [transmitted as other forms of lycanthropy]
in either form the stimulated effect [ full moon, night/day, emotion, freewill etc] will see the individual switch genders [this will be a full change with no discernible/detectable signs of the change this may or may not induce infertility or the gm can determine that pregnancy while in female form locks it -whatever suits.
This is a way to have a select NPC seriously confuse players
or it could be a PC variant if acceptable in a DM's game
Or it could be introduced as a curse or perhaps the side effect of a powerful magical artefact etc
Use in whichever ways suits