Sounds like you’re sorted, but bike size is a bit subjective depending what you’re doing. For more AM climby/big fast downy riding most these days seem to ride a frame that might be considered on the small side by traditional sizing, also with short stem and wide bars for extra leverage, and compensate on the climbs with a lot of seat post. More long spin/tech xc types light prefer slightly larger frames. DH people tend to value long top tube above all. In short, traditional ideas of sizing are generally adjusted to prioritise some aspects of riding at expense of others in a compromise. What works for you is what’s right. If you ain’t happy with it, you won’t ride it.
I bought a way too small bike when iI got back into it, then overcompensated with a couple of too-big larges. Eventually I got size right for me with and I’m normally M. 26’ers and 650, I’m 178cm with 32″ inside leg (sorry for units mix). I still have one of the 20″ bikes and it’s way big for actual mountainbiking but rides well for days I just plan to ride along moors or something…
Now the heat is off and you’ve decided to return it, at risk of sounding unhelpful I’d try and ride a few of your mates’ bikes or have a play in a shop or two. I’d agree a 650 may be more suited.