This claim is inaccurate and does not reflect the current scientific understanding of gender. Sex is typically assigned at birth based on biological characteristics (chromosomes, hormones, anatomy) and is often categorized as male or female, however gender is a social construct that encompasses identity, expression, and roles. Gender is a spectrum and is not binary. The idea that there are only two genders is based on a binary understanding of sex and gender, which is overly simplistic and doesn't account for the diversity of human experiences. It's important to note that some individuals and groups may hold different perspectives on gender based on cultural, religious, or personal beliefs. These perspectives should be acknowledged, but it's crucial to distinguish between personal beliefs and scientific consensus.
The APA states that "Gender refers to the attitudes, feelings, and behaviors that a given culture associates with a person’s biological sex. Behavior that is compatible with cultural expectations is referred to as gender-normative, while behaviors that are viewed as incompatible with these expectations constitute gender non-conformity...Gender is a nonbinary construct."
https://www.apa.org/topics/lgbtq/transgender-people-gender-identity-gender-expression
The WHO acknowledges that gender exists on a continuum. "Gender is used to describe the characteristics of women and men that are socially constructed, while sex refers to those that are biologically determined. People are born female or male, but learn to be girls and boys who grow into women and men. This learned behavior makes up gender identity and determines gender roles."
https://www.who.int/health-topics/gender#tab=tab_1
The assertion that there are only two genders is not supported by current scientific understanding or the lived experiences of many individuals. Gender is a complex and multifaceted aspect of human identity that exists on a spectrum.