The problem is caused by the TV auto downloading software updates and you allowing an upgrade while on a Wi Fi connection.
It must be on wired CAT 5 or better LAN CABLE back to your modem.
After it switches off and back on, it has now lost the Wi Fi password, so it keeps cycling off and on, as it cannot complete the set up with no Wi Fi.
I found that I had to go and deselect in the TV menu, to the get the IP details from 'automatically' to 'manual' to get out of the never ending loop of switch on and off.
My set was getting worse from once every 30 min to every minute, and it was not a soft turn off, but the audio was violently loud.
I have this happen several times over the years since 2012, and had banned at the modem from connecting to Samsung TV Software update. I had to factory reset the modem from another issue, but unfortunately an update slipped past me and onto the TV.
Nothing ever gets better from their updates, but causes trouble every time with simple things like HDMI no longer working.
What you need to enter into your modem 's 'blocked sites' as www.samsungotn.net
Then it cannot update the software, but the apps on the Smart Hub will update.
Some apps crash on update and cause similar issues, and if you have no internet connection, they will not cause so much a problem.