I don’t think that is correct?

Like,

Aiui (this is from memory and I don’t remember where I read this, so you should take it with a good serving of salt), the term “gender” previously meant simply “type”/“kind”/“sort”, but became a euphemism for specifically the concept which was at that time known as “sex”, in the sense of like, the general typology of people into two major classes, one masculine/“the male sex” and one feminine/“the female sex”.
I’m not sure the reason a euphemism was used for this. I’m not sure if it was because of the word “sex” also being used for “sexual intercourse”, or if that came later .
Regardless, this use of the word “gender” usurped its previous meaning as meaning “type”, and largely overtook the word “sex” as the common/polite way to say it.

As such, at this time, the question/answer pair “What is the patient’s gender?” “The patient is male.” would have been, as I understand it, perfectly normal.

I imagine that, over time, with the word “gender” being used more of the time that “sex” would have previously been used to refer to the typology as it was then understood, the term “sex” became more strongly associated with sexual intercourse, and became more uncomfortable to use . (I know that probably like, 8-9 years ago, I felt uncomfortable using it to refer to the general typology. Of course, this is after the change I will describe next.)

Now, having this pair of different words that largely were used for the same thing, must have been quite convenient for the social theorists / social architects, who promoted a new* distinction . (* new in the sense of common familiarity etc, not in the sense of “there was previously absolutely no concept at all of [...]”. Of course there has been much historical precedent of a number of concepts of [thing] beyond the usual two. Check out the etymology of the word “bad”. As Ecclesiastes says, there is nothing new under the sun.)
Unsurprisingly, when dividing the one concept into two concepts, they chose to assign the one which they wanted to be considered to be the more important/relevant one, to the word which was more comfortable/less awkward to use.

And, being recognized by some as authorities, they managed to get this assignment of this division of a concept into two, assigned in the popular use, to these two distinct words.

However, I don’t think that at any point in this story, that “male/female” became uncommon as a name for both versions of the concept?

I would understand an attempt to associate male/female exclusively with “sex” in order to attempt to use the common-ness of “male”/“female” to re-orient things to have more of the emphasis on the concept which is now commonly referred to as “sex”, in much the same way that the naming of the two worked to put an emphasis on the concept now known as “gender”,

but, I don’t think that the fact of the matter is that many people tend to use “male” and “female” exclusively for “sex”.

I suppose there is a faction which tends to (especially in the case of “female”)? But it isn’t the majority.

I don’t claim that one shouldn’t attempt to influence how language changes over time to make it more in accordance with one’s preferences. I also have preferences about how language changes over time, and where I can, I try to further those preferences (e.g. I would prefer that people avoid using the word “literally” for emphasis, and I sometimes seek to further this goal by, mentioning it to people when I see them use it contrary to my preferences.)

But, as a fact-claim about the common meaning-i.e.-usage of the word “female”, the claim that “female” refers only to a “sex” and not to a “gender”, is (currently! This could change!) incorrect (except within certain circles).