I make a clean install every time I try a new ROM. I always put the ROM in the SD card and make full wipe including internal storage. That time I thought it is Magisk-related problem, so I also tried not installing Magisk, but it still happened.
---------- Post added at 01:15 PM ---------- Previous post was at 01:07 PM ----------
For me it happens quite often, kinda 1-2 time per hour with RR and PE, 1-2 time per day on LOS. I don't think it will work for me cuz I have tried RUU flash for several times, clean install as well but they didn't work. Anyway, I'm still so excited and gonna try your solution right after I finish my University entrance exam.