you should try to download a working TWRP and make sure to enable OEM Unlock first before writing the TWRP.
after u'll be enable to enter in to the custom recovery, just download magisk flashable zip and flash it through the recovery.
if fail to flash magisk zip try to format and try again.