"For instance, a rapist who did not claim to be trans until they were arrested should never be considered for a female prison."
No. They should not have been considered for a female prison. However, no male prisoner should be considered for a female prison. Because they are male.
It is not just for safety that they should not be considered for female prison, it is for female prisoner's welfare and privacy and dignity too.
There are many reasons. For instance, in an argument that turned physical a female prisoner has a much greater risk of serious injury if a male prisoner is violent. Simply going by past behaviour is not a good enough gauge as to whether a male prisoner is going to get violent in prison.
There was a female prisoner who complained about the behaviour of a male prisoner who would leave the shower curtain completely open while that male prisoner was showering so that all the female prisoners had to pass them.
Just because a male hasn't been convicted of a sex crime, doesn't make that male prisoner one who has a history that a 'case by case' assessment will pick up. The only way to keep female prisoners safe from any unwanted behaviour by male prisoners, is to keep male prisoners out of female prisons.
I think you are aiming for a 'moderate' approach, but the reality has shown that there is no way to protect female people except full exclusion from prisons, rape centres and refuges, and sports that you mention. Sports also has been very well analysed by the experts who state very clearly that there is no 'case by case' solution that works.
Also, 'case by case' requires someone to arbitrate who can and cannot be discriminated against. It is highly discriminatory in nature. Who is the arbiter? How is it done? It is a lovely theory, but it always fails on a practical level.
And it discriminates. By its very nature it means that one male person is considered somehow more deserving than another and that that arbiter has to reward those 'more deserving'.