I have a spare EdgeRouter 4 that was bricked but still appears operational, probably just having some sort of a boot error that I can’t see. I’ve been hunting for a more serious level factory reset guide and came across this (something I have yet to try): manual TFTP Recovery. Hope it helps if you’re stuck.
https://help.ui.com/hc/en-us/articles/360018189493-EdgeRouter-Manual-TFTP-Recovery#7
(Archived): https://westerfunk.net/archives/technology/EdgeRouter%20TFTP%20Manual%20Recovery/