If you dont need the data two options
1. Install GrapheneOS on it. It's absolutely a more secure option.
2. Reflash it using stock android at flash.android.com
There's a reason security-conscious roms like GrapheneOS and CalyxOS only support devices where the bootloader can be relocked after installing.