This sort of thing used to happen in Beijing (PEK) quite a lot although pax were informed at the gate before boarding. They used to line up the ‘offensive’ luggage behind the boarding gate desks waiting for the boarding passes to be pinged. The majority of the time it was power banks in hold luggage that were not permitted with pax being offered the choice, if permissible to carry in hand luggage or leave it behind.