That is the issue and the source of my confusion. The god in question did not change the gender, it just created avatars. Those are sometimes created in a male form and sometimes in a female.
But the god itself never changed gender (as far as I could find in the lore).
Avatars are, as far as I know, entities that can be infused and controlled by the will of the god but it is not the god itself.
Just like a human that controls a character in a video game, those characters are the avatars of the player but not the player himself.