A big part is leg vs torso length and arm length. If you have a short torso you will probably be more comfortable on a bike with a shorter top tube. It is not just frame size.
I have shorter legs and a long torso and arms. Used to be close to 5’9” probably getting closer to 5’8” and ride 56cm road bikes and 17.5”/18” mountain bikes. They fit really good.
John