This from the BBC article is incorrect:
In a judgement handed down via email, Lord Justice Holroyd accepted the statistical evidence showed proportion of trans prisoners convicted of sexual offences was "substantially higher" than for non-transgender men and women prisoners
But he said this specific claim was a "misuse of the statistics, which... are so low in number, and so lacking in detail, that they are an unsafe basis for general conclusions".
The judge did not dispute that the statistical evidence showed proportion of trans prisoners convicted of sexual offences was "substantially higher" than for non-transgender men and women prisoners.
What they said was a "misuse of the statistics" was to extrapolate from that to say that this meant that a trans woman was 5-6 times more likely to sexually assault another female prisoner.
These aren't the same thing, because one refers to a historic fact (they have a conviction for a sexual offence) whilst the other refers to a possible future act that hasn't happened yet (sexually assaulting someone else). Those two things are distinct and the judge is correct to call attention to that. However, the BBC article has missed the point here.