Did you try running the onboard diagnostics? After the system has had a chance to reset, press the ***D*** and hold then restart your system to enter into diags.
Reference: [https://support.apple.com/en-us/HT201255|Mac startup key combinations]
Let us know what the error/s are.
If nothing comes back then you’ll need to look deeper into the systems thermals. Install this great app! [https://www.tunabellysoftware.com/tgpro/|TG Pro] it will allow you to see the sensors and the fans. With the full version it can capture the even before the system looses the condition.