This happened to me once and I have not been able to simulate it again.
I don't know if it was something to do with my timing opening the door while turning the truck off or maybe undoing the seat belt at the same time but anyway when I turned the truck off I could not remove the key fob.
I tried turning the key to on and off, no go.
I tried starting the truck and turning it off again and still no go.
Last attempt I started the truck put it in drive and moved it a couple of feet forward and then when I turned it off the key came out as normal.
No idea what was going on.