Once you lock the bootloader the option isn’t greyed out anymore, it’s only greyed out while the bootloader is unlocked.
That’s why tricking the system, via Magisk, into thinking the bootloader is locked makes that switch toggleable again.
It does, but keep an eye on get_unlock_ability and don’t install any ROM with an older patch level.
Your device is affected by this bug, be careful not to brick it.
And I would flip the OEM Unlocking switch to ON, otherwise, if something happens to your system, you won’t be able to fix it by unlocking the bootloader. Have a look at this post for a nice comparison of the different states.