[Moto G5 Plus Questions & Answers] apoorvsharan:
So my moto G5 plus has had a problem. I was on stock oreo and it just crashed one day prompting "Your device didn't start up successfully". So I repaired it using the Lenovo software repair assistant and it worked quite perfectly. Now that I had a reset I thought of trying Pixel Experience [AOSP & CAF] ROM and flashed it.

It crashed again and now Lenovo software repair assistant is not able to repair it. Any particular reason? I had USB debugging on and OEM set to unlock when this ROM was working fine. I downloaded the stock ROM repair assistant suggested and tried fastboot way but it also didn't work. There was always remote failure.

Also, adb isn't detecting my device. fastboot is detecting though. here are some details:

C:\adb>adb devices
List of devices attached
*blank*

C:\adb>fastboot devices
ZY223XXJ9S fastboot

C:\adb\ROM>fastboot flash partition gpt.bin
target reported max download size of 534773760 bytes
sending 'partition' (45 KB)...
OKAY [ 0.004s]
writing 'partition'...
(bootloader) Validating 'gpt.default.xml'
(bootloader) Security version downgrade
(bootloader) Image primary_gpt failed validation
(bootloader) Preflash validation failed
(bootloader) Cancelling 'gpt.default.xml'
FAILED (remote failure)
finished. total time: 0.077s

C:\adb\ROM>fastboot flash bootloader bootloader.img
target reported max download size of 534773760 bytes
sending 'bootloader' (5115 KB)...
OKAY [ 0.117s]
writing 'bootloader'...
(bootloader) Validating 'bootloader.default.xml'
(bootloader) Committing 'bootloader.default.xml'
(bootloader) - flashing 'emmc_appsboot.mbn' to 'aboot'
(bootloader) Failed to erase partition
(bootloader) Failed to flash partition aboot
FAILED (remote failure)
finished. total time: 0.326s

C:\adb\ROM>fastboot flash logo logo.bin
target reported max download size of 534773760 bytes
sending 'logo' (2186 KB)...
OKAY [ 0.051s]
writing 'logo'...
(bootloader) Failed to erase partition
(bootloader) Failed to flash partition logo
FAILED (remote failure)
finished. total time: 0.064s

C:\adb\ROM>fastboot flash boot boot.img
target reported max download size of 534773760 bytes
sending 'boot' (16384 KB)...
OKAY [ 0.380s]
writing 'boot'...
(bootloader) Image signed with key bad key
(bootloader) Failed to erase partition
(bootloader) Failed to flash partition boot
FAILED (remote failure)
finished. total time: 0.486s

C:\adb\ROM>fastboot flash recovery recovery.img
target reported max download size of 534773760 bytes
sending 'recovery' (20580 KB)...
OKAY [ 0.462s]
writing 'recovery'...
(bootloader) Image signed with key bad key
(bootloader) Failed to erase partition
(bootloader) Failed to flash partition recovery
FAILED (remote failure)
finished. total time: 0.615s

C:\adb\ROM>fastboot flash dsp adspso.bin
target reported max download size of 534773760 bytes
sending 'dsp' (16384 KB)...
OKAY [ 0.356s]
writing 'dsp'...
(bootloader) Failed to erase partition
(bootloader) Failed to flash partition dsp
FAILED (remote failure)
finished. total time: 0.369s

C:\adb\ROM>fastboot flash oem oem.img
target reported max download size of 534773760 bytes
sending 'oem' (104608 KB)...
OKAY [ 2.268s]
writing 'oem'...
(bootloader) Failed to flash sparse image
FAILED (remote failure)
finished. total time: 2.279s

C:\adb\ROM>fastboot flash system system.img_sparsechunk.0
target reported max download size of 534773760 bytes
sending 'system' (256557 KB)...
OKAY [ 5.592s]
writing 'system'...
(bootloader) Failed to flash sparse image
FAILED (remote failure)
finished. total time: 5.621s

C:\adb\ROM>fastboot flash system system.img_sparsechunk.1
target reported max download size of 534773760 bytes
sending 'system' (256617 KB)...
OKAY [ 5.602s]
writing 'system'...
(bootloader) Failed to flash sparse image
FAILED (remote failure)
finished. total time: 5.726s

C:\adb\ROM>fastboot flash system system.img_sparsechunk.2
target reported max download size of 534773760 bytes
sending 'system' (254213 KB)...
OKAY [ 5.576s]
writing 'system'...
(bootloader) Failed to flash sparse image
FAILED (remote failure)
finished. total time: 5.636s

C:\adb\ROM>fastboot flash system system.img_sparsechunk.3
target reported max download size of 534773760 bytes
sending 'system' (256710 KB)...
OKAY [ 5.672s]
writing 'system'...
(bootloader) Failed to flash sparse image
FAILED (remote failure)
finished. total time: 5.735s

C:\adb\ROM>fastboot flash system system.img_sparsechunk.4
target reported max download size of 534773760 bytes
sending 'system' (256912 KB)...
OKAY [ 5.649s]
writing 'system'...
(bootloader) Failed to flash sparse image
FAILED (remote failure)
finished. total time: 5.811s

C:\adb\ROM>fastboot flash system system.img_sparsechunk.5
target reported max download size of 534773760 bytes
sending 'system' (257861 KB)...
OKAY [ 5.629s]
writing 'system'...
(bootloader) Failed to flash sparse image
FAILED (remote failure)
finished. total time: 5.764s

C:\adb\ROM>fastboot flash system system.img_sparsechunk.6
target reported max download size of 534773760 bytes
sending 'system' (260027 KB)...
OKAY [ 5.705s]
writing 'system'...
(bootloader) Failed to flash sparse image
FAILED (remote failure)
finished. total time: 5.869s

C:\adb\ROM>fastboot flash system system.img_sparsechunk.7
target reported max download size of 534773760 bytes
sending 'system' (257557 KB)...
OKAY [ 5.623s]
writing 'system'...
(bootloader) Failed to flash sparse image
FAILED (remote failure)
finished. total time: 5.793s

C:\adb\ROM>fastboot flash system system.img_sparsechunk.8
target reported max download size of 534773760 bytes
sending 'system' (257826 KB)...
OKAY [ 5.628s]
writing 'system'...
(bootloader) Failed to flash sparse image
FAILED (remote failure)
finished. total time: 5.680s

C:\adb\ROM>fastboot flash modem NON-HLOS.bin
target reported max download size of 534773760 bytes
sending 'modem' (71925 KB)...
OKAY [ 1.580s]
writing 'modem'...
(bootloader) Failed to erase partition
FAILED (remote failure)
finished. total time: 1.592s

C:\adb\ROM>fastboot erase modemst1
erasing 'modemst1'...
(bootloader) Failed to erase partition
FAILED (remote failure)
finished. total time: 0.009s

C:\adb\ROM>fastboot erase modemst2
erasing 'modemst2'...
(bootloader) Failed to erase partition
FAILED (remote failure)
finished. total time: 0.008s

C:\adb\ROM>fastboot flash fsg fsg.mbn
target reported max download size of 534773760 bytes
sending 'fsg' (3012 KB)...
OKAY [ 0.070s]
writing 'fsg'...
(bootloader) Failed to erase partition
(bootloader) Failed to flash partition fsg
FAILED (remote failure)
finished. total time: 0.083s

C:\adb\ROM>fastboot erase cache
erasing 'cache'...
OKAY [ 0.065s]
finished. total time: 0.068s

C:\adb\ROM>fastboot erase userdata
erasing 'userdata'...
(bootloader) Failed to erase partition
FAILED (remote failure)
finished. total time: 0.009s

C:\adb\ROM>fastboot erase customize
erasing 'customize'...
(bootloader) Permission denied
FAILED (remote failure)
finished. total time: 0.007s

C:\adb\ROM>fastboot erase clogo
erasing 'clogo'...
(bootloader) Permission denied
FAILED (remote failure)
finished. total time: 0.008s

C:\adb\ROM>fastboot oem fb_mode_clear
...
FAILED (remote failure)
finished. total time: 0.116s

C:\adb\ROM>fastboot reboot
rebooting...

finished. total time: 0.003s

My device is connected to pc as "fastboot potter S"

I also trying getting the unlock key through fastboot. While I got the key, I was not able to unlock it (remote failure). Is there a solution? Any other details required from my side?

Fair warning: I'm so not a pro at this (clearly). I already ordered a new phone but the feel that I'm not able to get a solution from hours and hours of browsing xda is just disheartening. I refuse to give up on this one. Too many good memories associated with it :(