SO the security person was being professional, "Can I check your bag sir?" - sounds like a nice way to ask a customer for what could be unpleasant - that is asking people to delay their travel for a security search.
In my opinion, you were out of line for not respecting the security person's request.
I don't care how late you are for your flight. Get there earlier.
cpd