To be sure about your battery , First put your mobile on safe mode for 7 days and notice if restart will happen again or not? also notice battey consumption and charging rapidly mode.-
I was having same problem for last few months , when I put my nokia 8 on safe mode (Restart while pressing down volume button) ,the Restarting problem did not happen even once for 7 days, So I discovered that it is software problem that cause system to hang and restart and consume battery.. Then I discover that " many months ago on android Oreo" I was making changes in Devoloper mode To stop and prevent application from running in background , This was nice on oreo but on Android Pie it cause conflect and system hang with some application that refuse to stop causing system restart.. All problem had gone after allowing application to work again in background normally .. Till now for about one month no single restart >> Also , Rapidly charging mode working nice but unfournatly battery consumption Still high.