Unbricking a FRP-locked phone while leaving it rooted
Unfortunately, there is no way to unbrick a device and leave it rooted (1). You must flash the stock firmware into the device, thereby making it unrooted. Usually this a bricked device occurs when the device has been modified with so much alterations to the point where FRP detects it bricks the phone (3). The best way to counter this is to install a custom recovery image (like TWRP) to safely fix your device.