The problem is solved now. Thanks to a comment suggesting this link
I tried the 4th method in the link. But since volume up + power was restarting the device normally, I held down the power and was pressing and releasing the volume up button. The device didn't go in recovery mode but it rebooted and started working without the popup "unfortunately system UI has stopped".