Since you mentioned your system shuts down after parts replacement, I would suggest you to ensure that the processor fan is connected properly as it is the most common reason for this issue.
Also, check if the issue persists in safe mode. Restart the system and tap F8 key for advance boot options. Highlight Safe Mode with networking and hit enter.
If the system does not shut down in safe mode, you may perform clean boot to troubleshoot the issue. Refer to Microsoft KB Article 331796 using the link mentioned below:
Please keep me posted with the results.
Thanks & Regards