First off, there are sex chromosome combinations other than xx and xy. Some other combinations found in humans are xxy, xxxy, xxxxy, and xyy, as well as only one x chromosome. People who have a genetic mosaic may have some cells with xx and other cells with xy, in the same person. Individuals with multiple x chromosomes along with a y, will tend to be more female both physically and mentally than those with only one.
Secondly, there are a variety of possibilities with respect to genitalia. There are individuals who are ‘intersex’, who may be born with both sets, or have ‘indeterminate’ genitalia. In the past, some of those have had their genitalia “corrected” by doctors shortly after birth. What the doctors change them to may not match the sex chromosome combination of the individual, much less how they see themselves while growing up. Then we also find that some folks with xx chromosomes develop male genitalia, while some with xy develop female genitalia. It isn’t as simple as xx equals vagina equals female, or xy equals penis equals male.
Gender may also be affected by hormonal influences in the womb or in the world after being born. The human biochemistry is rather complex and genes may be turned on or off by environmental triggers. There are genes involved in brain sexual differentiation, which may or may not coincide with those genes determining genitalia. Some folks assume that mid 20th century European views of gender are the only correct view, yet there have been multiple human cultures where gender and sexuality have been seen in different ways, as a spectrum, or as with many Native American groups allowing for ‘two spirit’ people encompassing both female and male.
Those who demean transgender or non-binary people have little real understanding of the biology of gender.