I wrote a batch script that will generate an OEM-locking batch script from any Moto Z stock ROMs' flashfile.xml. It works flawlessly on my Moto Z (XT1650-03), but it's generic and may be of use for other Moto smartphones (Z2, Z3, Gn, En, etc).
moto-oem-lock.zip
Give it a try and place comments...