The relationship between chromosomes and sex can be complex with DSDs, as it is not just about the chromosomes (which can come in various patterns that are not just XY or XX) but also about the way the body's hormones are picked up and lead to male or female development. The production of sperm or eggs is a key factor (or developing the organs to do that, even if they don't do that).
This is why you can't just say XY always = male and XX always = female. That is true in the vast majority of cases but not always.
This is one of the reasons DSDs have been co-opted into (IMO specious) TRA arguments. Some people with a DSD really are incorrectly "assigned" a sex at birth based on appearance, which is not their true sex. That is nothing like being transgender, but it's used as a "gotcha". It also means that you can be male without being XY and female without being XX, and that is also used to undermine arguments that biological sex is a reality.