Caster Semenya is XY with a DSD (5-ARD), and absolutely should not compete with females. The same goes for Imane Khelif who was the same DSD.
People with this condition have internal testes, a male level of testosterone, and a male level of muscle development. That a doctor assigned them female at birth and put a F on the birth certificate does not change this.