I have had a similar experience on my way back from Bangalore to Newark. I had to change my flight in Mumbai. My baggage was checked in at Bangalore.
After Security check when I was about to board the flight, the security personnel asked me and all the passengers for that matter to handover the carry baggage as we are not supposed to carry in the flight. I was surprised. When I questioned, the officer in charge told me that I will have to miss the flight and go stay back if I disobey. I felt if I was in some DICTATOR Land. Unless we let go these inhuman officials who are senseless, we are going to suffer in this democratic country.