Chosen Solution
So I have had this custom built pc for about5 months and now after 10 minutes the computer randomly powers off. When this happens lights are still on in the back so the pc is getting power. And all the fans are working and are clean so I do not know what the issue could be.
Mine was doing the same thing. I believe since I have CRS disease, that I tracked it down to the BitDefender AV I was using. However, the point is that an app can cause that problem, so if the temps are not causing the CPU to shut down, start eliminating apps by turning off all none essential.
It sounds like it could be a malfunctioning fan on the power supply which is causing the power supply to over heat, which can cause a computer to shut down unexpectedly. maybe get the power supply tested, and if it is faulty i would strongly suggest replacing it asap. because it will start to damage other components of the PC and can become costly to fix. And if the power supply is working 100% then the next possibility is either, issues with a driver and or malware and for that i would suggest running a diagnostics on your pc and take it from there. I hope this helps you in resolving your problem and please let me know of the outcome. Thanks