More than likely this is a charge port issue. Essentially the phone is expecting check ins from the thermal monitoring service and it’s not getting data from 2 of the sensors (TG0V and TG0B) So the phone shuts off.
It could be other things as well, but charge port is where I would start. TG0V I am sure is in that flex. TG0B is battery, and the signal for that may also be carried by the charge port.