Is it possible that where ever you live has a wait time between purchases? If you were approved for the first yet denied for the second it may appear that you look like a "straw" purchaser", meaning you might be a legal citizen buying for criminals. Mind you this is just theory and your local shop might have more information. Obviously if they just sold you one legally and now they get a denial they may know the reason buried in the law. Kind of like obscure tax laws only the C.P.A.'s of the world know because they live for doing taxes.
Go down to the firearms shop and ask them in person why it happened. For all you know, they might have put it in wrong and you are mixed with someone else. Mistakes happen, computers screw up, and above all Murphy's law is prevalent in a lot of things. And you can always offer to put $20.00 to hold the pistol until things are straightened out. Know they will make a solid sale beats 20 customers who hem and haw and walk away. After all, you just bought one, so they know you mean it when you say you want that one also.
Keep your head up, and do the detective work. It will work out.