Sex encompasses more than the production of some gamete; it includes genetic and anatomical determinants, and it ain't exactly unheard of for those to get out of sync or otherwise produce sexes that are neither unambiguously male nor unambiguously female.
This is also why sex and gender are modernly regarded as distinct from one another, on that note.
The very first sentence of that Wikipedia article (let alone the rest of it) corroborates my comment.
> The concept you are referring to is "sex".
No, the concept I am referring to is gender. Sex is a spectrum, too, but that doesn't mean that gender is not.