I'm having the same problem with my M1 11". I noticed last week I was having some trouble charging... would only charge with the cable flipped a certain way. Then I plugged it in a few days ago and it would not charge regardless of the cable's orientation. Figured it was a bad cable, but it works fine to charge my iPhone, and trying several different ones on the iPad yielded the same result.
Also tried several different chargers, from a low-powered iPhone charger to a high-powered MBP charger, along with several in between. The only that that would work was plugging it into my MBP. Also tried shutting down / restarting, and reinstalling the OS. Nothing helped.
I was on the verge of going to buy a new one (which I really don't want to do at this point... the M1 is just fine for me), but prompted by a Reddit post from several years ago from someone with this issue, I let the battery run all the way down to shut-off... plugged it in to my regular charger, and it worked, charging fully. Hallelujah!
Unfortunately, my joy was short-lived. I tried to plug it in today, and once again it's non-responsive on any number of regular chargers and cables that I try, but it will charge when plugged into the MBP. So, now I need to decide if this handicap is bad enough to justify buying a new one.