This feels like a science lesson!
The first bolded section is a bit of a contradiction. In mammals, sex is determined by chromosomes & gametes - meaning XY & sperm = male, XX & ova = female. The fact Semenya has testes which produce sperm makes 'her' male/man. 46 XY 5-ARD (5-alpha-reductase deficiency) is a DSD which only affects males - in the same way prostate cancer only affects males. She recently stated in an interview that 'her testicles don't make her any less of a woman'.
The testes are THE ONLY defining factor, they're what make and distribute the male levels of testosterone, the same way as ovaries create the female levels of oestrogen.
As for the advantages, that basically means that Caster Semenya is an average male runner - not a world class female runner. What you're saying is all men should beat all women - it's simply not the case. The same goes for Imane Khelif, he is an average male boxer - the 9 losses he's suffered are because he's an average male boxer, but still has insurmountable advantages over biological females.
I feel for Semenya & Khelif - they didn't ask to be born with these conditions, but the biological fact remains that they're the wrong sex for the category they compete in. 0.00025% of the world's population are diagnosed with 46 XY 5-ARD, yet 3 of them won gold/silver/bronze in the 800m in Rio, does this not prove the massive advantage they hold over biological women?
Anyway, I don't want to ruin this thread with another debate so Ewa Swodoba eh!