But isn't the phone already on a stock rom? But that it's rooted? Or is it running an aftermarket rom like Lineage? Look in settings, software version to find out.
You can relock the boot-loader, but before trying to do that, you have to be running 100% stock, no modifications to the rom whatsoever. I've done that but have only attempted it after using lgup to flash a complete stock rom.
To re-lock it you have to use the engineering abl and qfil to flash it, then go directly to fastboot, re-lock, then use fastboot one last time to flash the original abl back.
look in the guides section to get an idea of how to do above.