Sounds like you got ripped! I'd be upset. Many shops will try to sell you what they have on the floor and not what you need. Maybe cause they don't want to order the right size or maybe unloading old stock they have on the floor.
Either way, they shouldn't have sold you the wrong size. MTB is very important to have the correct size. Not enough clearance in the crotch area can be very dangerous. Plus like you say, the balance and control.
Some good salesmen will flat out not sell you a bike if it's the wrong size. Some morons will to make a sale!
BTW, I'm 6'1 on a 19 inch Trek