So when in twrp, flash oos then format phone and then flash Magisk and reboot?
Make sure you take a complete back up of your internal memory. The Pie firmware has a bug where it will corrupt your internal data if you are flashing it on top of oreo firmware on an encrypted storage and unlocked bootloader. Here is what I did when I flashed the Pie OOS:
1. Bakcup internal memory to laptop.
2. Went to twrp and factory reset.
3. Then I "formatted" my internal memory. Note that I didn't just wipe, I formatted internal memory to remove encryption.
4. Flashed full OOS Pie zip. Then flashed twrp image in twrp. Then reboot to recovery. (this is important as rebooting into system without flashing magisk will flash stock recovery automatically).
5. Flashed magisk 19.2.
6. Reboot to system. It should now take about 15 minutes as OOS will re-encrypt your internal memory.
7. Reboot to recovery, flash my titanium backup zip, flash mcd kernel, profit!