Moto G6 not charging, not connecting via USB and battery indicator frozen at zero, not enetering battery saving mode Here is how problem came about:
I unlocked my moto G6's bootloader and fastboot flashed twrp-3.4.0-0-ali.img in it. I opened TWRP trough the recovery option in fastboot, and enetered my PIN, but TWRP was unable to decrypt my storage. I noticed that TWRP was showing that the CPU temperature was at 34ºC and battery full. Then, I clickend on &quot;cancel&quot; the operation, kept TWRP read only and rebooted to delete the fingerprint recognition in system settings, which I thought could have been causing the failure of TWRP to decrypt. That didn't work, but this time I shut my phone down with power button. I am unsure if I did so before or after cancelling the operation, but I didn't choose the option to keep TWRP read only. I also noticed TWRP showing a ridiculously high CPU temperature before turning off. Regardless, it disappeared. I can now boot normally but I am having the issues described in the title. I tried a factory reset from moto but it solve this problem.
I performed a full adb backup before unlocking the bootloader with the command

adb backup -apk -shared -all -f C:\Users\

However, I may not be able to restore this backup via USB, given that my phone is not connecting via USB.
Any ideas of what to try?
After factor resetting through fastboot (so called hard reset), rather than factor resetting through the settings (i.e. soft reset), I got my phone in order again.