This has happened to me before. After updating the software, battery health dropped a few percentages quickly. Not sure if Apple is trying to mess with us or not.
Otherwise, do a clean factory reset first and wait a few weeks until the operating system can optimize. If it still freezes and hangs, then it's likely caused by the iOS 17 software, might need to wait until it gets fixed in the next update.