I was having the same problem as OP; I removed the GrapheneOS key but could not re-lock the bootloader after flashing stock OS.
What worked for me was to flash the Beta 1 using the Android Flash Tool--then the tool happily locked my bootloader. Once complete, I used the Android Flash Tool to flash the stable release. The Tool makes you unlock the bootloader to flash, but when it comes time to lock the bootlader again it works!
Weird, but it worked for me. I hope this helps someone in the same pickle as me.