Even I have faced the same issues just after my phone warranty has expire and I have visited the nearest service center
The service centre said about to replace the battery and it would be good to go but that wasn’t the solution and they said about motherboard issues and said that they would say the estimated price which would cost a lot
But that wasn’t expected with just a old year phone without any physical or internal damage
Probably it’s a software problem with Nothing and this should be replaced for free in the service center
Did you find any solution please let me know