1. You don't say where/what state you were in - not that it matters in the US, but laws vary so help us out here. US Handgun law site would be a start for you.
2. Did you have your recorder on? Did you video anything. So it's your word against his. Recorder=gun returned. No Recorder=maybe file suit to get HG cost money??
I'd have obeyed the order and gotten a video and a badge number and you saying I am going back into my house but will you confirm I'm on my property we are not under marshal law, yada yada. Then fight it in court
You could even have put the HG back in the house and gone outside with an obviously empty holster - again, recorder and video cam turned on - your own property, informed officer you were recording him - videoed property line, etc. He can tell the judge you were in his face in the street, for example and you can't prove you weren't.
He cited you with a catch all phrase. Misdemeanor. Cost you $500 to fight it, I'd guess.