My 14 pro did this within 24 hours of having the phone. It completed full iTunes restore via iMac, and everything was all setup.
Used it a couple of hours at night, and went to bed charging it on MagSafe. Woke up to 100%, and about an hour later, decided to connect to charging cable. I immediately noticed it rebooted since it asked for passcode rather than Face ID. Hoped it was one time thing… nope. It did it over and over again. It stayed on no problem unplugged, or on MagSafe. As soon as I plug in a charging cable, it rebooted every 1-2 mins.
Did factory reset, and the same issue. Tried DFU restore, but it wouldn’t stay on long enough to complete it, and kept on rebooting. Blasted the port with compressed air, and the same issue. Oddly enough, using a little bit of alcohol to “clean” the brand new charging port, and after that, it never rebooted. But I had already asked Apple to send me a replacement anyways by the time it somehow fixed itself, plus the battery life on it SUCKED. I know brand new batteries need a few days to settle in, but it went down by 50% in half a day without using much at all. Also it kept losing wifi connection occasionally.
I’m currently using the replacement one, and it’s been working flawlessly. No excessive battery drainage, no wifi issues, no reboot. I think it was simply a lemon. It’s frustrating and not ok to have any issues with especially over 1k worth brand new device at all, but glad to see some of you are having similar issues so I know I wasn’t crazy haha.