Anyway, after the rude comment she just smirked and wrote XXX or something like that on my boarding card. I was like whatever, but when I got to the line at the gate and they checked my boarding card I got taken into a run for a "special" inspection. So unless you love body cavity searches don't be stupid and say things you are going to regret to TSA agents.
You're lucky that it was only hand written. Some people get that printed on their boarding pass which means it will pretty much always happen to them.
I had a special sticker placed in my passport by Australia because I left my passport laying on the counter while having work gear inspected and paperwork. Didn't realize it until attempting to check in, and then left all of the gear with my coworker while I ran off to get the passport. When I returned with it, the official that was "helping" us with our gear placed the sticker in my passport. Everytime I returned to AU, I got the special screening minus cavity searches. It was my own damn fault, and I was never rude to anyone about it, but yeah, I probably did look a bit shady running off after leaving a stack of large pelican cases. Oh well, that passport has now expired and the new one is sticker free.
I would expect immigration and customs to check the green card. Immigration has never checked my boarding pass for what would be a potential onward flight. TSA would be at different area in the airport.
https://www.tsa.gov/travel/security-screening/identification