What you posted is indeed what most people are taught in school. However, it's only a very basic rule of thumb that's highly simplified to the point of inaccuracy. Scientists have long understood that there is way, way, waaay more to sex/gender than XX or XY, or what someone's genitals look like. For example, fetal exposure to sex hormones is known to play a major role in sexual development, and current research suggests that it plays a role in whether people are trans*. As with most genetic traits, multiple chromosomes are involved in sexual development, along with epigenetic factors (conditions that affect DNA expression).
Many, many people have intersex genitalia, or three or more sex chromosomes. Some people are XY but develop as female because they're insensitive to male hormones. So are these people "wrong," or is the simplified XX/XY definition wrong?
Furthermore, countless societies throughout the world have (or had) three or more genders. Having two genders is no less arbitrary than having three or four. The concept of an XX/XY sexual dichotomy only sounds natural to us because it happens to match our culture's gender binary.
And, as I've shown, people who are experts in this subject consider transgender to be a real thing, and medical transitioning to be a medical need.