There's a difference between gender and sex.
Sex is the reproductive organs and the pelvis shape, and gender is how people feel and want to be viewed.
I, for example, and genderfluid, my S/O is nonbinary, one of my best friends is trans, and I know countless people who are other genders as well