This computer hasn’t been serviced for a while and had quite a lot of dust built up on the CPU fan plus the heatsink.
This was preventing efficient cooling which was causing the CPU to overheat. In order to prevent damage to the CPU, a thermal shutdown kept occurring once it reached a certain limiting temperature.
I removed the fan and heatsink to clean off all the dust. Cleaned the CPU and applied new thermal paste in order to give better heat transfer from the CPU to the heatsink.