This morning, my wife's iPhone 15 Pro wasn't charging. Tried 3 different USB-C cables, each with a different charger (well, 2 with chargers, 1 with my old 2017 iMac). I thought we'd have to take it in, then on my iMac I noticed the dock's Finder icon bouncing, and clicked it.
A box popped up saying something to the effect the iMac detected a phone/device/whatever in DFU mode. Basically, it wouldn't charge it till it got out of that.
I'd never heard of it, so I Googled. It's Device Firmware Upgrade mode. Which told me...pretty much nothing. But it looked like turning the phone off, then back on, might sort it out. It was down to 3%, so not much time to act.
Turned the phone off, then back on, now it's charging fine.
No idea why it was in DFU mode. Neither of us knew what they was.
If you haven't tried turning it off and on yet, might be worth a shot.