PS: I no longer use the phone due to its many problems.I can send u patched system.img for flash via TWRP if u can send me version of previous installed stock Samsung rom
Anyways, I managed to install TWRP on the stock system image. I did this by flashing the TWRP image with the pre-rooted GSI and rebooting into bootloader mode (download). After that, I flashed the stock system image by extracting the AP file and then compressing it to .tar via 7z. After flashing, I booted into recovery and flashed the multidisabler.zip and then wiped Cache, Data, and Dalvik. I rebooted my phone after that. No security check errors, All okay. I tried to reboot into recovery the 2nd time and Twrp is still there. Also, flashing Magisk won't root the device, you will still end up in the same security check fail screen, even if you reflash the stock boot image, It won't go away (prob bcs of twrp). You will need to reflash the stock ROM for it to go disappear.