Gender is an aspect of inflected language, as in gender, number and case. Sex is an aspect of human reproduction, as in male or female. The equation of the two is a phenomenon of contemporary times.
For example, "the dummy" in German is "der Dummkopf".
"Der" signifies it is a masculine noun, singular in number, and nominative as to case.
"Der Dummkopf" functions as the subject in a sentence, for example when Michael says "The dummy says gender when he means sex".
When it is the indirect object in a sentence, it is spelled "dem Dummkopf", in the dative case, as in "Michael said to the dummy . . .. "
Michael Savage talks to many dummies, "den Dummköpfen", who are plural in number and dative in case, who don't understand the difference between gender and sex.
There is no answer to "What is your gender?"
To "Sex?" the answer is either male or female.
And sometimes "Yes".