<rant>No offense, folks, but please consider not posting unless you have something useful to contribute to the issue. "Yeah, this sucks" is completely true and also unhelpful. "Me too" is really only helpful if we know the type of phone, iOS version, how/when you charge, and what you have tried for troubleshooting. You can always redirect your complaint mojo where it has a better chance of helping from the backside: submitting at feedback.apple.com, or the Apple forums, or calling AppleCare. Or all three, if you're really worked up.</rant>
My iPhone 13, iOS 17.1.1, has been spontaneously restarting every single night for weeks. Pretty sure it started with iOS 17 update. I charge it at night on an Apple MagSafe wireless charger, horizontal, so StandBy is active. Every morning it says I have to enter my passcode because the phone has restarted.
I have just disabled green charging. If that doesn't change anything, I'll try vertical charging (so StandBy isn't active), then plugged-in charging (thanks, bigdshaw). Will report back after a few sleeps.
Edit 11/16: I changed three things, terrible troubleshooting I know, but I had to sign out of iCloud on my phone for other reasons...so, the three things I did yesterday: 1) disabled green charging; 2) signed out of iCloud (deleted data from phone, restarted, signed into iCloud, restarted again); and 3) put the phone on the MagSafe charger in a vertical orientation (no StandBy). I'll put it horizontal tonight and see if it restarts again; maybe it's a bug with StandBy, which wouldn't surprise me given the relative complexity of this new feature, and the fact that it has to have its tentacles in so many core areas (graphics, power/charging, screen brightness, connectivity, etc. etc.).
Edit 11/17: No reboot last night, while in horizontal orientation (StandBy active). I'll enable Green Charging for tonight and see what happens.
Edit 11/18: Repeated config from 11/17, and the phone rebooted (left Green Charging off).
I'm calling this a StandBy bug. I've never had it reboot when charging vertically, so vertical charging it is unless/until Apple fixes StandBy.