[Moto G5 Plus Questions & Answers] LLegion:
Bro, u have to excatly follow these instructions, having downloaded all files, including the deodexed and debloated, do as it says in both tutorials:

https://xdaforums.com/g5-plus/development/stock-debloated-deodexed-t3619972

the other files i have used succesfully: https://drive.google.com/drive/folders/0B--58xBx8PTOcVhhVmFFMzhHYzg?usp=sharing

[1] Do as told to set your windows in test mode with drivers, after applying cmd command, restart your laptop and continue with tutorial 2.

https://xdaforums.com/moto-g4-plus/help/solved-unbrick-hard-bricked-dead-t3585016

[2] Follow as crystal clear as it says (dont download anything else besides what i have placed in my gdrive and the debloated rom, thats all you need):

!!! U may try both blankflash files: ALBUS and VACHE, may depend on your model which one works well to revive motog5

Bro if it's detected as qhusb 9008 in device manager then Then do this in order:

1. Extract Potter blankflash files then connect your mobile to pc if mobile led is blinking then press and hold power button you could hear that mobile disconnects and connects once you hear that then press voldown and power with one hand and run blankflash.bat in the extracted folder both at the same time once you see the script running release vol and power keys if you hold it then also it again skips it so timing is important both should be done at the same time if it fails 1st time then do the same procedure again power by pressing power button once again you hear those sounds of disconnect and connect run the blankflash.bat holding voldown and power at the same time repeat this until you see the scriptis successful once ii is blankflashed it boots to bootloader menu. Remember leave vol and power buttons once you see the script is running.

2. Now in fastboot mode keep the three files that you extract from addison2potter.zip in fastboot folder and run the following commands

fastboot flash partition gpt.bin

fastboot flash bootloader bootloader.img

Fastboot flash recovery recovery.img

fastboot reboot-bootloader

3.now you can flash only the deodexed stock rom because flashing stock is failing saying that security downgrade error may be downgrading bootloader is not possible.

4.flash the twrp 3.1.1.0 available at xda and now flash custom recovery using the following command put the twrp zip in the fastboot folder then type

Fastboot flash recovery tw and and press tab it automatically selects the folder then flash it.

5.finally after opening twrp and wiping everything now copy the downloaded debloated stock rom to mobile and flash it thorough twrp once it is flashed then reboot to bootloader then now again flash the same 3 files gpt.bin, recovery and bootloader using the above commands and now exit fastboot mode and now it boots into the rom successfully.

5.if you want to flash any custom ROM you can do it by again flashing the twrp and any custom ROM available for Potter without flashing the deodexed stock rom the modem IMEI is not working so that we have to flash deodexed stock rom and then you are good to go with any custom ROM and they will have the baseband and you can use them.

Finally your Potter will be back.

All credits goes to vaches for creating the blank flash file and addisons images and senior members of this thread who discussed about it and helped in reviving Potter back.