It's more like for the longest time sex and gender did indeed mean the same thing but at some point some guy was like "LOL! They are totally different!" And people ignored him for decades until relatively recently.
You're really just fooling yourself if you think anyone saying there are more than two genders are gonna be totally fine if someone were to say "Okay, fine, there are more than two genders, but when it comes to sex there is just male and female."