[flagged]
Having an XY karyotype is just a proxy - albeit a typically very accurate one - for determining sex. The important thing is which of the two pathways of reproductive system development dominated. Ultimately, this system is what sex is all about.
Here's a decent article on this topic, considering the applicability of various definitions of sex: https://theparadoxinstitute.com/blog/2021/04/10/what-are-sex...