Oh GlasgowJohn, I would have pissed in my pants anyway!
First of all, I don't know what weird rules there could be (or could be made up to put me in a bad spot). For example, in 2007 I was arriving at JFK and they decided to inspect my hand luggage. I had declared I had food with me (I think, I can't recall exactly) or anyway I hadn't crossed all 'NO' on the green entry card I was given on the plane.
So the lady started inspecting my luggage and finds two pandoros. She asked me what were those and I told her 'Traditional Italian xmas cakes' (it was Christmas time, btw!). They come in a cardboard box and she wanted to open it. I offered to help but she said 'hands off'. She just checked they were industrial made and the bag was airtight sealed and let me go.
But another time I was arriving in Boston with my husband to drive south to Florida and visit the East Coast. An Italian friend had offered to let us sleep at his place. Naturally we had asked how we could repay him. He asked for a couple of salamis and added 'Don't worry, last year we came home with a whole ham leg and nobody could care less'. So I had completely forgot about his salami. We had two big suitcases as it was a 40-day trip and we had been packing for two weeks, so we had forgotten about the treats for our friend.
Of course we arrive in Boston, pass immigration and CBP stopped us asking if we had anything to declare. We said no, but their dog said otherwise. They inspected my husband's bag and found the salami.
My husband was visibly shaken, but unlike me (the pant pisser) he started being upset because the officer started challenging him and calling him a liar and saying 'so you lied, you lied to my face.'
My husband replied he didn't know that it was not permitted (these were industrial salami, just not vacuum sealed) and the agent warned him there was a 200 USD fine or whatever. Now, my husband is a sweet guy, but don't touch his wallet... he started getting angry and became all red. He bit his tongue, though, and repeated profusely he was sorry, to take the salami, and that he wouldn't repeat the same mistake. Eventually the officer let us go, but he asked for my husband's passport and entered something in his system. Maybe a strike or a note of the inspection.