The only way to boot into the system is to flash the entire stock firmware through the fastboot.Hi @diogen78. Thanks for your extensive feedback including log files and screenshot!
Something is wrong with your log. For some reason it's not removing shared_blocks read-only feature properly. Not sure why. Compare with other successful mylog.txt files from this thread and you will see what I mean.
To get out of bootloop in addition to restoring stock read-only super image you can try to re-enable dm-verity and verification using the included avbctl binary.
If you can only access fastboot then I would suggest downloading stock firmware (same version that's installed on device) from your phone manufacturer website and then flash the vbmeta partitions + stock super.img
(Script only modifies vbmeta* and super partitions)
Please report back your results. Good luck!
Bash:fastboot --enable-verity --enable-verification flash vbmeta vbmeta.img fastboot flash super super.img
Then I get root again through patching boot.img with magisk.
Then:
1. Backup super.img by Partitions Backup & Restore or Universal Mount SystemRW.
2. Flash stock super.img without any changes
fastboot flash super super.img
3. Device does not boot into the system. Stays in fastboot mode.
It turns out that the problem is not about the script, but the fact that it is impossible to make a valid backup of super.img.