Non-binary gender identity and roles have been present in human societies dating as far back as 4500 years ago[1]. The only thing relatively new in the last 100 years is the moral panic about it.
Furthermore, from a scientific standpoint, there's not really any such thing as a clean binary division between male and female. Chromosomes get messy, and even absent issues with the X and Y chromosomes themselves [2] there's some fun stuff with the SRY gene [3] and hormonal receptors in utero that can affect gender identity and presentation [4].
Actual intersex conditions occur at a rate of approximately 0.018%. [1] This is a pathology, not a third category.
[1] https://pubmed.ncbi.nlm.nih.gov/12476264/