This is exactly what I am dealing with on my 16 Pro Max running iOS 26.2. I have been on the phone with Apple over 2 days providing videos of this happening. They forwarded my videos to engineering for review and a solution. Check your phone and see if you catch it restarting when it’s plugged in to power or charging wirelessly as this is also a related problem. It doesn’t do this when running on its battery. I have factory reset my phone once and put the phone into DFU mode and restored, forced reset with no success. For now I disabled CarPlay in my truck and just connect via Bluetooth. The only way I have found to get CarPlay working is to plug the phone in and let CarPlay freeze, then I power down my phone wait 30 seconds before powering up and the unlock the phone after powering up and connect via my USB C cable or wireless depending on what connection you have. Then CarPlay works just fine. I have to do this every time I get in the truck.
IMO this is related to charging and or CarPlay since this is the only time this happens. If anyone has a iPhone don’t update to iOS 26.2, this all started after that.