These are also very human-centric! There are vertebrate animals that don’t use chromosomes as their sex-determination system (reptiles and some birds can also use the environment to determine sex) and there are vertebrate animals that use different chromosome arrangements.
Birds for example, don’t use XX/XY, they’re ZW/ZZ. In birds, the egg determines the sex (not the sperm) and females are the heterogamous sex (with ZW chromosomes). There is plenty of room for variation, too - a ZZW bird who presented as female successfully laid and hatched her own eggs (x)
Platypuses, meanwhile, have a system that resembles both XX/XY and ZW/ZZ in function, but the form is a little baffling. Platypus males are XYXYXYXYXY, and females are XXXXXXXXXX.
Clearly, there is nothing perfect, universal or holy about XX/XY - and anyone who insists there is has demonstrated that they don’t know anything about biology.
And it’s a fluid system even once you grasp the idea of chromosomes - we know that you can hack sex in lizards to create “superfemales” (by incubating an egg with “male” chromosomes at a temperature that hatches “female” babies). Superfemales present as females and can lay viable eggs. You can do it with lizards that happen to use the XX/XY system, and hatch fertile males with XX chromosomes. You can do this with chickens as well - take a “genetically male” fertilized egg and incubate it at the perfect temperature, and you can hatch a “male” chicken that will lay eggs for you. The difficulty is that this only works some of the time in chickens - the cooler temperatures that hatch female chickens tend to kill the male embryos that don’t transition, which is wasteful. Otherwise, this would revolutionize the poultry industry.
So now we know that XX/XY is like the Windows 7 of sexual determinism (lots of people use it, but would be silly to call it the only operating system in the world) how fixed is “sex” anyway? Well, most of us know that clownfish can change sex - if there are changes in their social structure, the dominant female can transition from a reproductively functioning egg-fertilizing male to a reproductively functioning egg-laying female. Bio textbooks say that clownfish “don’t have” sex chromosomes, but I think it’s more likely that they do, but that they don’t have any function. At any rate, the change is down to hormones, which change in response to the social environment the fish is in.
So are hormones, then, the Thing That Totally Definitely Determines What Men and Women Are? Not really. Before puberty, human children don’t have many sex hormones circulating in their bodies, and human children are often quite clear about their own gender. Humans who have had ovaries removed, or who go through menopause, no longer have waves of “female” hormones sloshing around - but we still call most of them “women.” Humans who have had their testicles removed or their androgens depleted (usually because of testicular or prostate cancer, which can feed on hormones) are usually still called “men.” And ovaries produce natural levels of testosterone quite happily, because they need to - just at lower levels! Pregnant humans often have particularly high levels of testosterone. Weirdly, “male” partners of pregnant people often drop to lower levels of testosterone than usual - their pregnant partner’s hormones influence their own biology. But a cisgender father of a fetus does not stop being a male just because he has less testosterone.
Pregnancy gets weirder, too - decades after the fetus has moved out, a pregnant person who once harbored an XY fetus will have XY cells in their body and brain. If you looked at, say, Molly Weasley, you’d be able to find “male” tissue in her brain - where her body traded for some fresh young stem cells from her fetuses, and used them to replenish her own older tissues. So a cisgender person born XX can exhibit microchimerism later in life and never know it. But having XY tissue in your brain doesn’t make you a man.
Okay, so what about gender roles? Surely those are clear - surely those are necessary for sex and sexuality and the Natural Order and all those things?
Well, we also know that animals practice a range of gender roles. Again, a lot of it is more obvious in fish, reptiles and birds, partly because sexual dimorphism tends to be more pronounced in these animals. But there are plenty of species in which you get multiple “types” of sexes. The most common is the territorial/satellite male arrangement, in which there are multiple distinct types of males, with different genetics, behavior, life history, physical appearance and courtship strategies.
Ruffs, a type of sandpiper, have distinct territorial and satellite males, plus “faeder” males that were only recently discovered to be male; faeders are identical to females in appearance and most behavior, and plenty of previous sightings of lesbianism in ruffs were probably faeder/female matings. Satellite and territorial males top faeders, but as faeders also top satellite and territorial males, researchers have interpreted this as “ruffs are perfectly aware that faeders aren’t the same as females, and none of them give a shit.”
Above are some different forms of masculinity in ruffs. The bird on the top left is a female; the birds below are the different male types. In the picture on the right, the independent and satellite male are vying for the attention of the female; the faeder is the brown one on the left. The territory belongs to the territorial male, who will defend it from other territorial males, but he doesn’t attack the satellite and faeder males, because they aren’t in competition. (Imagine your OT4.)
Outside of that, gender roles aren’t as important as humans pretend they are. There isn’t really a Breadwinner/Housewife divide in the animal kingdom because most animals don’t practice capitalism. Performative masculinity only benefits species that gain an evolutionary advantage from it. Non-human mammals don’t find mammary glands to be sexually arousing. Mostly, animals just try to survive in complicated, complex environments that are constantly trying to kill them. The rules are: 1) adapt to changes in environment by being resilient, adaptable and diverse; and 2) successfully pass on the genes that succeed in your environment. You don’t need to be “fit” or fierce or have lots of bright plumage - those are not your objectives and may, in fact, distract you. You don’t even need to mate, or be fertile, or have children of your own - you just need to make sure that your traits survive, and hopefully help your species after your death. There is nothing in the rules about the superiority of special genital configurations, which animals are allowed to touch the color pink, and who gets to grow a beard.
Tl;dr : every time a human tries to come up with a hard-and-fast rule about what “sex” or “gender” or “male” or “female” means, there is a bird somewhere that has quietly devoted the past 2 million years of its existence to proving that person wrong.