[Moto Z Questions & Answers] lesbianu:
I have a two month old Sherridan RETEU (dual SIM). I passed through all the OTA's till the latest Oreo OPL27.76-51. After that, I unlocked the bootloader to use Magisk and some custom kernel (ElementalX - with the loss of the WiFi at this moment).

I wanted to experiment more, and moved on to the unnofiicial LineageOS 15.x and last week on the official version of the same LineageOS.

The motivation for doing all above was the fact that in the battery stats that Mobile Network Standby was the highest consumer. Happened the same with root, with custom kernel and the LineageOS. So, I started to believe that the culprit it's on the hardware part of the phone... Something related to the signal (even if I used 2 different SIMs from 2 different providers - each on different slots of the SIM tray).

Yesterday I decided to try to return to stock and to lock back the bootloader... And it worked!

First I recovered my TWRP backups to stock (boot, system, data, and after testing the stock recovery) and tried to run: fastboot oem lock (similar to the Nexus phones that I owned before). No luck. Was requesting for different partitions to be flashed before running the fastboot oem lock command.

Seeing that, I grabbed the GRIFFIN_OPL27.76-51_cid50_subsidy-DEFAULT_regulatory-DEFAULT_CFC.xml firmware, unzipped it, said a prayer and pasted the commands I found on a topic here on XDA:

fastboot getvar max-sparse-size
fastboot oem fb_mode_set
fastboot flash partition gpt.bin
fastboot flash bootloader bootloader.img
fastboot flash modem NON-HLOS.bin
fastboot flash fsg fsg.mbn
fastboot erase modemst1
fastboot erase modemst2
fastboot flash dsp adspso.bin
fastboot flash logo logo.bin
fastboot flash boot boot.img
fastboot flash recovery recovery.img
fastboot flash system system.img_sparsechunk.0
fastboot flash system system.img_sparsechunk.1
fastboot flash system system.img_sparsechunk.2
fastboot flash system system.img_sparsechunk.3
fastboot flash system system.img_sparsechunk.4
fastboot flash system system.img_sparsechunk.5
fastboot flash system system.img_sparsechunk.6
fastboot flash system system.img_sparsechunk.7
fastboot flash system system.img_sparsechunk.8
fastboot flash system system.img_sparsechunk.9
fastboot flash system system.img_sparsechunk.10
fastboot flash system system.img_sparsechunk.11
fastboot flash system system.img_sparsechunk.12
fastboot flash system system.img_sparsechunk.13
fastboot flash system system.img_sparsechunk.14
fastboot flash oem oem.img
fastboot erase carrier
fastboot erase cache
fastboot erase userdata
fastboot erase DDR
fastboot oem fb_mode_clear

fastboot oem lock
fastboot oem lock
fastboot flash oem oem.img
fastboot flash system system.img_sparsechunk.0
fastboot flash system system.img_sparsechunk.1
fastboot flash system system.img_sparsechunk.2
fastboot flash system system.img_sparsechunk.3
fastboot flash system system.img_sparsechunk.4
fastboot flash system system.img_sparsechunk.5
fastboot flash system system.img_sparsechunk.6
fastboot flash system system.img_sparsechunk.7
fastboot flash system system.img_sparsechunk.8
fastboot flash system system.img_sparsechunk.9
fastboot flash system system.img_sparsechunk.10
fastboot flash system system.img_sparsechunk.11
fastboot flash system system.img_sparsechunk.12
fastboot flash system system.img_sparsechunk.13
fastboot flash system system.img_sparsechunk.14
fastboot flash boot boot.img
fastboot oem lock

The bootloader was locked, the phone booted, everything looked OK. But... On each reboot or fresh start the phone stopped into bootloader menu and I had to manually choose START. A factory reset did not helped, so I started digging on Google and finally arrived back to XDA where on an old Motorola topic I found the solution:

fastboot oem fb_mode_set
fastboot oem fb_mode_clear
fastboot erase userdata
fastboot erase cache
fastboot reboot

This is the result!