Same issue here. I can more or less work around this by leaving my M1 MBP closed/sleeping for a while, and then it will charge OK. It seems to be triggered in my case by accidentally dislodging the MagSafe connector a couple of times in a row. Definitely didn't happen pre-Sonoma.