I also had facing these issue after the purchase of one year the phone suddenly dead while watching YouTube.. the issue is due to overheat the cpu got dried and damaged and the current channel to camera and mic is damaged in mother board
I got same issue in my s22ultra.. even i also thought the same .. went to service centre they had reinstall software and all.. but after some days issue occurred again .. finally got understand board issue..