That sounds suspiciously like an issue with a faulty battery. If the phone is brand new then it is still under warranty and should be repaired or replaced by Apple without cost.
Note that the battery is paired to the motherboard on your phone so if you were to replace the battery yourself or have it replaced by a non-Apple authorized repair shop, you will end up with a warning that the battery may not be genuine and you'll lose access to the battery's health information in Settings. However, even with those caveats a new battery should still work without the reboots.
Normally you could sidestep that warning and loss of health info by swapping the BMS, or Battery Management System from your old battery to a new bare cell, but I wouldn't advise that in your case since it sounds like your BMS is flaking out.
You might want to see if there are any panic logs stored on your phone; if so they could help with a more definitive diagnosis of why the phone is rebooting. I'd suggest you take a look at the Kernel Panic wiki page to learn how to access any logs that are present.
iPhone Kernel Panics - iFixit
Should you find a current panic log, copy and paste or screenshot the first page of it and post it to your question. If we see one, we can take a look and try to figure out what problem it is indicating.