iPhone goes into auto-lock mode, shuts off when connected to charger
Hello, I'm currently using an iPhone XS. Recently, I updated it to iOS 17.1. After this update, I noticed that when I plug it into the charger, it begins charging as usual. However, after the screen dims and the phone goes into auto-lock mode, within one minute, it unexpectedly shuts down and won't charge. Even if I press the power button, it won't turn on. Unplugging and plugging it back in has no effect. Strangely, if I unplug it from the charger for about 5 seconds, the phone automatically turns on without needing me to press the power button.
[Re-Titled by Moderator]
iPhone XS, iOS 17