Its notimho about inside leg, as a prev poster mentioned, but how comfy you feel when reaching the bar. The thing about frame sizes is as they get bigger (taller) they also get longer.
I am 5’6-5’7 ish, with a 30 inside leg. For clothes for example, sometimes I am a cut long 29 in m&s clothing,and sometimes a cut short 31. However, despite getting away sometimes with medium legs, I am always in suit/jacket terms, a “short” in the topbody.
With bikes, it’s the same. I tried a 53cm Boardman Road bike, and it was far too long for me, the reach to the bars was so far, that Whislt I could just about reach them, my control over the gears/brakes and stearing would have been limited, and I didn’t want to “gamble” on “adapting” to the bike over time pysiologically. I eventually then bought a Bianchi 49cm road bike, and whilst it can fel a tiny bit “compact” up front, it’s far more comfy than a “superman” position that the larger frames needed, even if all the measuring guides suggest a 52/53 cm frame should be my fit.
In terms of mountain bikes, it depends more on the maufacturer. Orange mediums seem to fit me, as do Kona’s (well, the one’s I’ve tried) but in trying Marin and Specialised, I always needed to drop down to a small size. You do need to try a bike rather than buy on the basis of a rave review for this reason.