I am very sure it is the Sonoma software, since upgrading, the same wire and charger is intermittent. Apple please own up the problem and solve it. it is really very annoying.
One solution which seems to work is unplug the USB cable both ends, swap over and replug, seems to solve it temporoiary