I had this issue a couple of times on my iPhone XS Max, it was a few days over the 14 day return period. The second time it happened I didn’t bother restarting it and took it into Apple to show them and explained it would work if I restarted, they ran a diagnostic and it came up with a couple of errors. They didn’t tell me what (I saw it on their iPad with exclamations), and offered me a brand new retail box exchange.
So my warranty is now reset, changed to gold and haven’t had the problem since (knock on wood)!