I think this debate should only include prisons, which are controlled environments. I agree with you that statistically more women are at risk at home from violent husbands or parents or even "friends".
If I understand correctly, there are two different groups of transgender women in prison.
1. Ordinary trans women already living as such before being arrested and are serving a sentence for some random crime. They don't even appear in the statistics because they already have a gender recognition certificate. As you say their number must be small.
2. Prisoners who apply to be considered transgender
after being arrested or convicted, so they currently have a case conference.
The BBC's "reality check team" verified the claim by a feminist organisation that 41% of this category are serving time for sexual offenses.
In 2018, in England and Wales, there were 125 transgender prisoners in category 2.
60 were serving time for sexual offences, including 27 for rape, 5 for attempted rape and 13 for sexual assault/attempted sexual assault. Therefore 40%.
I'm not going to enumerate the crimes against children here, since there aren't children in the women's prison and I don't want to throw up.
They don't say which gender the transgender people are, but in the UK "rape" is only penetrative, therefore biological women are hardly ever convicted for the rape of an adult.
This is of course both alarming and eyebrow-raising. 40% of those transgender prisoners are serving time for sexual offenses and either they are already in women's prisons or they are in a process that could end up putting them there. (The MoJ doesn't give information either way.)
This is compared to around 19% of sexual offenses for male prisoners and around 3% for female prisoners.
Personally, I don't believe for a minute that transgender women commit this much rape. IMO rapists pretend to be trans women to have an easy time in prison or to find new victims.
Convicted rapists and dangerous murderers shouldn't be put into women's prison's, to sleep in a cell and share the showers with women whose majority come from backgrounds of abuse. Period. Some incredible examples are happening in the USA as well as the UK and the judges, somehow, are deaf to the pleas of the women.