Make sure you have the stock OS installed to both slots. Also make sure encryption is disabled. Try using
fastboot boot twrp.img then try flashing the installer. After flashing the zip, use the menus in twrp to reboot directly back into recovery.
After rebooting into twrp
wipe > format > type "yes" to continue. Reboot directly into twrp from the menus once more. See if you can mount
/data. If that works, flash any recent version of magisk that you know works on stock. If you run into any errors let me know.
If everything goes well... Let the OS boot up once, and see if Magisk is installed. If it's good to go, reboot into recovery and verify that twrp is working. If you have both, try making and restoring a fresh backup.
Just a note, if you run LOS 17 and need root, flash the stock unmodified boot.img before flashing phh superuser.
Download: twrp.img