This illustrates one of the 'unenforceable' parts of the NEC.
110.3(A)(1) states that in judging an installation, 'suitavility' shall be considered. Too often, this is limited to looking for a UL lable. That's a mistake, in part because (2) goes on to address the 'adequacy' of the protection. (8), at the end of 110.3, even has a 'catch-all' provision allowing for the consideration of 'other factors.'
110.12(B) addresses the integrety of equipment, saying that there shall be no damaged parts that may affect safe operation.
The second part of the puzzle was that inspections happen only in response to a permit at the time of installation. There seems to be no provision for anyone to act afterwards - even when the failings are not only obvious, they are in a public place (and thus there is no expectation of privacy).
Were I to be asked to repair such an installation, I would consider it a requirement to take the impact of shopping carts into account with my repair. If that meant adding a guard, additional supports, or even changing the wiring method, I would do so. Simply replacing one failed system with another inadequate one does not, IMO, meet your code obligations.