I recently purchased a late 2015 iMac and promptly replaced the hybrid drive with a 2TB SSD from OWC (Other World Computing). My next upgrade was bumping RAM up from 32GB to 64GB.
After upgrading memory and swapping out with OWC a 2nd time I still had some random issues with iMac shutting down and restarting. I did the usual stuff, I ran hardware test and then a tool called Rember to test memory further. Everything tested out positively. No detected hardware issues, memory stress test checked OK...but the persistent issue of random shut down / restart had me ready to pull out some hair out.
I thought running the MacOS Catalina upgrade might help so I downloaded via "About this Mac", but I kept getting a message that the file was corrupted. I downloaded from Apple and got some message. On the third attempt, I downloaded the file to an external drive thinking my SSD might be possible cause.
After scratching my head a few times I decided to remove the upgraded 64GB memory and reinstall the factory 32GB RAM.
SURPRISE!!! I re-downloaded Catalina upgrade through software update tool under apple icon / About this Mac and I was able to complete the upgrade. I did however run into a few issues.
NOTE: If you use wireless keyboard mouse, you may need to reset your PRAM. Because of this I could not connect any wireless devices to complete Catalina OS install. I found an old Apple keyboard with cable and ran to BestBuy to purchase an $8 corded mouse to finish the install / setup.
Once completed, I was able to reset PRAM and activate bluetooth on my iMac.
The interesting thing for me in this process is that the memory created some sort of issue that caused a corruption error when trying to do the upgrade and also the random shut-down / restart issue. I have not had time to circle back around on that issue.
In closing, I would make sure you are not doing any upgrades and trying to install Catalina OS at same time. Run the update first and then work through any potential hardware upgrade issues as they come up. I'm going to call OWC and see if they have any insight on this issue and will follow up here with another post.