Phone repair guy here. Sounds like a thermal issue. Could be one of three things: the battery, the CPU, or the charging circuit. The battery might be faulty and getting too hot when charging/under load. The CPU might not be thermally bonded to the heatsink properly so it heats up …