I have an Samsung Note 9 and it happens on my phone as well. I had found this option in the settings or something that enables this feature but I don't remember where that option is now.
A few months ago I had installed a custom rom and it was working fine. I decided that I didn't like the custom rom and found a copy of the factory rom.
I installed the rom and it was working fine for awhile when one day it started to reboot itself. I did some research and apparently an update...