TWRP runs a series of assert() commands at the beginning of the updater script. These check your device’s codename, bootloader version, or modem firmware. If any assert fails, the script aborts with Error 255.
If you don’t want to wipe data, try flashing a “Disable DM-Verity and ForceEncrypt” zip before the ROM. However, for Error 255, a full format is more reliable. error 255 twrp flashing rom
If you're comfortable editing the ROM zip: TWRP runs a series of assert() commands at
Open the log file and search for: