Maybe he was honest and told the officer that there was a gun in the car, because he didnt want to escalate the situation. It is better to go to jail for a couple few hours than it is to get shot in a misunderstanding. If you do not consent to a search, you will be detained until a K9 makes a pass around your car. And then if the K9 hits on something they are gonna search it anyways, then find whatever you didnt want them to find when you did consent to a search, and then your chance of a couple few hours in jail becomes days, weeks or months maybe more.