Thanks.Didn't try all the intricate ways yet (reflashing the stock firmware, then Magisk-patch it all, etc.) but the simplest, which is use Odin over whatever I have (LineageOS that is with the stock recovery) and flash, fails for me. It just hangs forever on the Sam logo screen. Interesting thing: LineageOS hangs on the boot animation if I am using the "purged" vbmeta (and I have to use it to flash TWRP, of course, otherwise Download gets excited over missing signatures). Theoretically it shouldn't affect anything at this stage of the booting process but it does.
Is your device made in Vietnam or India?
There seems to be some difference.