Phone doesn't charge anymore after reaching 1% battery level

Hello,
I’ve a Sony Xperia Z5 with /e/OS (I installed this ROM).
It was working and charging fine. Yesterday I forgot to charge it, it reached 1% battery and I turned it off. Now I try to charge while it’s off but it doesn’t charge and doesn’t even turn on.
I tried charging with an official Samsung charger (output 5.0V, 2.0A)

I could I solve this issue?

Regain your privacy! Adopt /e/OS the unGoogled mobile OS and online servicesphone

I manage to solve it by booting into the Recovery (TWRP, which I had already installed on the phone), and then reboot from there.
Interestingly, in TWRP it said 39% battery, so the battery was actually recharged during the attempts. The thing not working was only the battery recharge animation while phone being off.
However, still even if the issue was solved, I still don’t know why the phone was not booting (and looked dead) if the battery was indeed 39%.

Maybe some software glitch/error preventing the power on?
Booting into recovery (key combination) might have actually reset the error ?!