Look at it from the shop's side. How many times have they probably heard the line; "Oh I don't have enough money/cash on me, I'll go get some more, and be right back" from the customer. Only to have the person never come back?
Having worked in retail many moons ago, I've been on the receiving end of that line and never saw the person again. What a person should do is offer to put a down payment of few dollars (like $50) to hold the gun, if the shop will allow it, ask for a written receipt of the down payment (in case they try to screw you later), and then go and get more money to pay for the gun. Otherwise its first come first serve for most retail businesses. Sucks that the OP missed out, but the shop was looking to sell it on the spot and they did so. The OP's choice now is to go elsewhere and buy, there by denying this shop future sales for their past actions.