There are many tens of thousands of third-party and no-name chargers, and Apple only tested hundreds, or maybe thousands. The vast majority of chargers, including all chargers for which Apple is responsible, work fine.
Actually no, Louis Rossman has uploaded a video where an Apple-branded charger observes this behaviour. So no, this doesn't work with a vast majority of chargers, including the ones Apple is responsible for.