Cursory glance at XDA tells me that OnePlus devices need an unlock token for that device to re-lock the bootloader but you would have to roll back to the original factory firmware to do so.
https://forum.xda-developers.com/t/relock-bootloader.4412627/
Sucks that vendors can keep such a tight control on what you can do with your device. Would be nice to have the possibility to safeguard your device with any OS of your choice.