You are exactly correct on this. I once spent some time in the Amazon in Equador. Was rained on for days. On trip back out of jungle, caught jungle bus (rooftop ride), only to encounter the bridge was washed out. Hiked 17km with all my gear to get to Tena. Literally caught bus to Quito by running in front of it. Hoped on bus for a long bus ride. Two hours later bus was stopped at army checkpoint where we had to show our papers. Everyone was allowed back on the bus but me. Spent 4 hours standing next to guys with machine guns (furious staring does not harm them), until I was able to stop a pickup truck and hired the guy to take me to Quito for $10US. Spent the night in the back of the truck lying on sacks of coffee beans watching the Southern Cross as we drove through the Andes Mountains. He dropped my off at Quito International at 6am with minutes to spare. Had time to shrink wrap my backpack and board my flight - still in the same clothes and boots I was wearing in the jungle the day before.
When I landed in Panama you have to push a red button at customs. If the light flashes green you go on your way. If it flashes red you get searched. I got red. They made me take the shrink wrap off my backpack, as they were asking me where I had been and what I was doing. Long story short, she only got the zip on the pack open about six inches, as I was explaining I had just came from the Amazon Jungle. She was getting a good whiff of me by then too. The zip was quickly done right back up and I was sent on my way.