"The concept of gender, in the modern sense, is a recent invention in human history.[26] The ancient world had no basis of understanding gender as it has been understood in the humanities and social sciences for the past few decades.[26] The term gender had been associated with grammar for most of history and only started to move towards it being a malleable cultural construct in the 1950s and 1960s.[27]…
Before Sexologist John Money and colleagues introduced the terminological distinction between biological sex and gender as a role in 1955, it was uncommon to use the word gender to refer to anything but grammatical categories.[1][2] …
Analysis of more than 30 million academic article titles from 1945–2001 showed that the uses of the term “gender”, were much rarer than uses of “sex”, was often used as a grammatical category early in this period. By the end of this period, uses of “gender” outnumbered uses of “sex” in the social sciences, arts, and humanities.[2]"
Social sciences, arts and humanities are not true sciences. They are therefore sloppy with their application of terminology.
"
It was in the 1970s that feminist scholars adopted the term gender as way of distinguishing “socially constructed” aspects of male–female differences (gender) from “biologically determined” aspects (sex).[2]
In the last two decades of the 20th century, the use of gender in academia has increased greatly, outnumbering uses of sex in the social sciences. While the spread of the word in science publications can be attributed to the influence of feminism, its use as a synonym for sex is attributed to the failure to grasp the distinction made in feminist theory, and the distinction has sometimes become blurred with the theory itself; David Haig stated, “Among the reasons that working scientists have given me for choosing gender rather than sex in biological contexts are desires to signal sympathy with feminist goals, to use a more academic term, or to avoid the connotation of copulation.”[2]…
In J.E.B. v. Alabama ex rel. T.B., United States Supreme Court Justice Antonin Scalia wrote:
The word ‘gender’ has acquired the new and useful connotation of cultural or attitudinal characteristics (as opposed to physical characteristics) distinctive to the sexes. That is to say, gender is to sex as feminine is to female and masculine is to male ".[30]
In 1926, Henry Watson Fowler stated that the definition of the word pertained to this grammar-related meaning:
“Gender…is a grammatical term only. To talk of persons…of the masculine or feminine g[ender],
meaning of the male or female sex , is either a jocularity (permissible or not according to context) or a blunder.”[32]…
The popular use of gender simply as an alternative to sex (as a biological category) is also widespread, although attempts are still made to preserve the distinction . The American Heritage Dictionary (2000) uses the following two sentences to illustrate the difference, noting that the distinction "is useful in principle, but it is by no means widely observed , and considerable variation in usage occurs at all levels."[35]
The effectiveness of the medication appears to depend on the sex (not gender) of the patient.
In peasant societies, gender (not sex) roles are likely to be more clearly defined." WIKIPEDIA
You are not interested in preserving the distinction.