The question of whether or not a male athlete should be in female competition isn't difficult. They shouldn't.
Athletes and people in general discover shocking things about themselves every day. If we are talking about someone born in a country/area without access to routine maternity care, competing in lower levels or in younger age groups, probably nobody would know or suspect about the CAIS for a long time. But by the time a person is an adult, they will know or suspect that something is up. Especially since AIS and 46XY 5ARD runs in families and therefore there are clusters in certain populations.
As soon as an athlete does find out, it is incumbent on them to stop competing with women. The Open category would be ideal, if there is one. But never the female category.
They don't have to announce the reason, although I think it might be healthy for people generally to be aware of such conditions, but obviously that's their decision to make.
We should bring back sex passports for competition above a certain level/age. Cheek swab, one and done for life.
There is no need or justification for compromising fair competition for all females in order to protect the privacy of a few males if they are determined to carry on competing in the female category.
The CAIS person I remember (username of Alex?) was male, though socially a woman. Sport is different, though. Fairness and safety are paramount.