[Moto G4 Plus Guides, News, & Discussion] echo92:
Okay, sounds like you were on the March 2017 update (NPJS25.93-14.4), in which case you might want to download the ROM and follow the guide from here: https://xdaforums.com/moto-g4-plus/how-to/stock-rom-npjs25-93-14-4-march-1-t3608138 It's been listed as working on XT1640 devices too.

As for your question regarding those 2 commands - you'll note from the video your bootloader/fastboot will prevent you from flashing a GPT/bootloader partition image older than your existing images on your device. Though the checks should stop you (and hopefully not stall the flash), it's perhaps best to ensure it doesn't downgrade those partitions by omitting the commands yourself. It's been noted in the past that downgrading your GPT and/or bootloader may result in a brick. As an aside, if you downgrade your system, you may wish to update using the fastboot images rather than OTA updates, to ensure your system is stable and reduces the risk of a brick, however, OTA updates may be safer and more stringent these days. (I was able to downgrade from a fastbooted Nougat NPJ25.93-14 to MM 6.0.1, without GPT/bootloader flashing, and then take the OTA back to NPJ25-93.14, however your experience may vary).

Besides, if you were on the March 2017 update, you could flash the stock ROM mentioned above for the least headache (not downgrading, just restoring your system) :)

A few things I noted from the video (also, those links in the video are advertising hell, just a heads up!):

1) The ROM being used in that video is MPJ24.139-50 - a Marshmallow stock ROM and I've downloaded this ROM to confirm it. Unless you want to downgrade to Marshmallow, you may wish to use a Nougat stock ROM in place of the ROM mentioned in the video. The files should be in the same configuration as the ROM in the video, thus you may be able to use the same commands as those listed in the video for the Nougat ROM (or follow the steps in the Nougat ROM :)).

2)There's newer adb versions - the latest is 1.4.2 (up to you if you choose to update your adb terminal: https://www.androidfilehost.com/?fid=745425885120698566 )

3)As long as you're in the bootloader when you're flashing, should be okay to flash. You don't have to be in the logs, though if you want to see what's going on, should be okay.

4)Those errors that fastboot reports in the video suggest the flash didn't work at all.... lots of [FAILED] 'remote failure' with 'preflash validation error'. Possibly because the bootloader is locked (oem_locked status on the bootloader screen), which may be blocking the flash (only upgrades are permitted, if I recall, on a locked bootloader, maybe reflashing the same ROM too?). Normally, a flash if it's worked would report [OKAY] at the end of the flash. The Youtuber may well say it was successful, because nothing happened (though I wish the Youtuber showed us the device booting properly after the flash...), or just simply demonstrating the procedure of flashing. Given your bootloader is unlocked (and you're flashing stock), you should be okay to flash.

Hmm, from my personal view, although the video covers the general steps of flashing, the software sources could do with updating (e.g. to Nougat as mentioned above). I'd flash the NPJS25.93-14.4 stock fastboot ROM, personally, unless you're keen on downgrading to Marshmallow. I'd also suggest to confirm that the MPJ24.139-50 build is for your XT1640 too.