What you saw was a security process in action. The flaw or security loophole would have been if this didn't happen - but it did, so there is no problem. All luggage in the aircraft cabin and hold has been screened. For whatever reason a passenger has to get off the aircraft. This process (which is a PITA for the crew and will almost certainly cause a delay) ensures that the passenger does not leave anything behind and all luggage in the aircraft is accounted for. Any checked luggage in the hold would also have been removed.
If there is a whiff of loco bashing here, in my experience some of the locos run a far tighter ship than some of the legacies.
Out of interest Mariner, what would be necesary to satisfy you under these circumstances? Serious question. (Forcing the passenger to travel isn't a viable answer).