"It is wrong to say that the sex class is defined: "
To clarify:
Can we say that XX and XY define sex? No, SRY- XY makes a female, as an example, and SRY+ XX makes a male.
So can we say being SRY+ defines sex? Well not exactly in that an AR gene mutation on an SRY+ XY person also creates a phenotypically female (CAIS).
So if a person has a normal AR gene, and is SRY+, are they male? Well not necessarily. The way the human body creates hormones is very interesting. Hormones are synthesised ultimately from cholesterol, and there are multiple androgens synthesised in the human body, not merely testosterone, but also DHT. An SRY+ XY human with a normal AR gene but with a mutated SRD5A2 gene will not produce DHT.
DHT causes formation of male genitalia in utero, body hair, male pattern baldness, prostate enlargement
Testosterone causes spermatogenesis, voice deepening, male skeletal development, sex drive, acne
So someone who is otherwise male in important respects (will produce viable sperm at puberty, will grow male structure, etc.), can be born with female genitalia and socialized as female, while possessing internal sex. Are they male? Well yes in that they produce small gametes. Some may go on to identify as male after testosterone works its effects during puberty. But that's not always the case.
There are quite a number of genes involved, e.g., the HSD17B3 gene affects the production of the 17β-HSD III enzyme, which converts androstenolone (itself a weak androgen) into testosterone and mutations in HSD17B3 result in under-virilisation including female genitalia in XY babies. Most XY babies raised as female will change gender identity to male after puberty as there is SOME virilisation, the androstenolone/testosterone balance is upset, but this is sex is not deterministic per se.