If you pay attention, your source has an asterisk of “typically” and “usually”, aswell as a distinction between phenotype and karyotype traits. While it is true that the majority of people with a Y chromosome are male, there are many people with Y chromosomes you’d call female because of their phenotype (which is what society primarily cares about), among other cicumstances.
I specifically said sex. Gender is mostly undefined. If you say that gender is the societal presentation as male or female, but you can’t define male from female then what are you defining? Its the “trans women are women” contradiction.