This is what I do and it always works.
BACKUP - only do the backup for boot, system, and data. That is all that works anyway
STEPS TO RESTORE
1. Clean flash the room you made the backup on. If using OOS like I am just use a fastboot rom. It will wipe everything for you and makes this possible.
2. Start the rom up and complete the initial setup - you don't need to sign in to Google or install any apps just get through the setup or this will not work
3. If TWRP was installed on the phone for the backup, install the same version of it here. Same thing applies for magisk. When this is all done reboot to recovery.
4. Restore system, data, and boot only.
5. Reboot to system and enjoy.
I know this is complex and a serious pain in the butt, but it is the only way I found to make this thing work. Let me know if you have any questions.
Hey man, i know this is an old post, but i had to come here to thank you! been pulling my hairs since yesterday, trying to restore my nandroid backup after messing around with a rom, your steps worked like a charm! cheers