I have an S8 with the latest update installed. So a few days ago my phone started restarting randomly. Tried every fix, completely wiped the phone 3 times (Factory Reset), took it to the service center for fresh software and even a battery change. But nothing fixed it. I even tried safe mode but it didnt work. Thought the Logic board was somehow bad and its casuing it to happen. But I finally figured, the Secure Folder was casuing the problem all along. I dont know since which update caused this to happen. But there is almost no posts about this online except one on some xda developers forum. So here's how it goes, every time you try and install secure folder seperatelly after factory reset or fresh software install, the bug happens so that once every minute the phone would auto reboot, casuing it to heat up and very frustrating to use. So to prevent it from happening, you gotta uninstall secure folder, remove all cache and other possible residues of that app and disable it for good. So until samsung decides to fix this (which they probably wont cause S8 is 5 years old now and no one would care for random and a very rare bug). But I felt like I had to put it out..so there you go.
sorry to hear that you are experiencing this. I would recommend sending an Error Report after the issue happens via our Samsung Members app so this can be investigated. To do this launch the Samsung Members app> Get help> Error reports.