Try replacing your battery. Usually, they have a two years lifespan. When dead for no reason, most likely, is the battery.
Had similar issue, for no reason, went in bootloops. Flashing new didn't fix it.
Replaced the battery, hard reset, then re-flashed it just to be safe.
Worked like a charm.