A case in mind was a gentleman that was legally possessing a pistol on an aircraft that got diverted to NYC.
Being an honest gun owner he declared the firearm when changing flights. He was arrested, jailed and if I remember right had one of the gun rights insurance policies that helped him, and there was a court fight. I think the NRA got involved as well.
Spit balling here on the incident from memory.
My advice here is to NEVER accept your checked bag with a firearm in it, should you get diverted or have an unexpected layover in a ban location. Even if it comes off on the baggage carousel on the public side, the airline is required to collect all unclaimed bags and take them to their baggage service office or ticket counter to secure for the passenger. You can stand there and watch it go around until they pick it up. Once they have it, you can go to their office and ensure they put it back on whatever plane you depart on at a later time or date. They must securely retain it until then.
They cannot force you to accept it other than at the final destination on your itinerary. Even then, you can request they "Hot Shot" it to an address or location of your choosing which is away from the airport (some additional fees may apply). Don't ask for anything out of the bag. Whatever toiletries or change of clothes you might need are cheaper to buy than getting caught in an anti-gun honey trap. By following these measures, you never have to re-declare the firearm and by not physically taking possession of it, you can't be charged.
Even if an airport LEO is standing there ordering you to take your bag, this is the one case where I would refuse such an order. Don't do or say anything except refuse to take the bag and assert your 5th Amendment rights to remain silent. Don't admit or deny the bag is yours, even if they have your ID in hand and match it to the bag tag. Don't admit or deny the bag contains a firearm. Don't answer their questions even when they try to bluff you with "obstructing an investigation". They can't force you to commit a crime or surrender your constitutional rights.
Simply put, the gun in the bag isn't worth the hell they're trying to put you through.