Alright, I found the problem thankfully. It was due to the SIM card in my phone. I need to remove it when restarting the phone, unlock it, and only then I can put it back in.
If I restart with the SIM inside, the screen will just keep flickering until it restarts itself.
Very weird glitch, but...