Neuropsychoanalysis can answer this question. The biological functioning and substrate of humans typically operates below consciousness. Genetics and neurology are biological. Jung’s archetypes are transmitted genetically between successive generations. Archetypes of the collective unconscious are genetic and have such an ontological basis.
I view gender as mostly a cultural construct, though in more mainstream literature (as well as certain legal contexts) it’s regarded as a social one.
The concept of gender is “newer” than its biological analogue (sex) in both science and, seemingly, pop discourse. As such, the collective understanding of the former is less-developed in Western society.
As a socio-cultural concept, then, gender is closer to character (a social concept) than to temperament (biological). By definition, the idea of sex becomes more relevant to one’s temperament than to character.