[Moto G5S Plus Questions & Answers] briant97:
I have tried following guides on going back to stock rom but getting many errors in doing that. I have also tried flashing many different roms with TWRP. I get many errors when doing that one of them is local error 7. One also tells me that it detects OEM partition now at potter. The model of this device is XT1806.

This is my attempt to get things back to stock.

C:\Program Files (x86)\Minimal ADB and Fastboot>fastboot getvar max-sparse-size

max-sparse-size: 268435456

finished. total time: -0.000s

C:\Program Files (x86)\Minimal ADB and Fastboot>fastboot oem fb_mode_set

...

OKAY [ 0.000s]

finished. total time: 0.000s

C:\Program Files (x86)\Minimal ADB and Fastboot>fastboot flash partition gpt.bin

target reported max download size of 534773760 bytes

sending 'partition' (45 KB)...

OKAY [ 0.016s]

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.094s

C:\Program Files (x86)\Minimal ADB and Fastboot>fastboot flash bootloader bootloader.img

target reported max download size of 534773760 bytes

sending 'bootloader' (5115 KB)...

OKAY [ 0.141s]

writing 'bootloader'...

(bootloader) Validating 'bootloader.default.xml'

(bootloader) Committing 'bootloader.default.xml'

(bootloader) - flashing 'emmc_appsboot.mbn' to 'aboot'

(bootloader) - flashing 'rpm.mbn' to 'rpm'

(bootloader) - flashing 'tz.mbn' to 'tz'

(bootloader) - flashing 'devcfg.mbn' to 'devcfg'

(bootloader) - flashing 'cmnlib.mbn' to 'cmnlib'

(bootloader) - flashing 'cmnlib64.mbn' to 'cmnlib64'

(bootloader) - flashing 'keymaster.mbn' to 'keymaster'

(bootloader) - flashing 'prov.mbn' to 'prov'

(bootloader) - flashing 'sbl1.mbn' to 'sbl1'

OKAY [ 0.538s]

finished. total time: 0.695s

C:\Program Files (x86)\Minimal ADB and Fastboot>fastboot flash modem NON-HLOS.bin

target reported max download size of 534773760 bytes

sending 'modem' (71925 KB)...

OKAY [ 2.068s]

writing 'modem'...

OKAY [ 1.067s]

finished. total time: 3.151s

C:\Program Files (x86)\Minimal ADB and Fastboot>fastboot flash fsg fsg.mbn

target reported max download size of 534773760 bytes

sending 'fsg' (3024 KB)...

OKAY [ 0.078s]

writing 'fsg'...

OKAY [ 0.109s]

finished. total time: 0.203s

C:\Program Files (x86)\Minimal ADB and Fastboot>fastboot erase modemst1

erasing 'modemst1'...

OKAY [ 0.047s]

finished. total time: 0.047s

C:\Program Files (x86)\Minimal ADB and Fastboot>fastboot erase modemst2

erasing 'modemst2'...

OKAY [ 0.047s]

finished. total time: 0.047s

C:\Program Files (x86)\Minimal ADB and Fastboot>fastboot flash dsp adspso.bin

target reported max download size of 534773760 bytes

sending 'dsp' (16384 KB)...

OKAY [ 0.488s]

writing 'dsp'...

OKAY [ 0.284s]

finished. total time: 0.787s

C:\Program Files (x86)\Minimal ADB and Fastboot>fastboot flash logo logo.bin

target reported max download size of 534773760 bytes

sending 'logo' (2192 KB)...

OKAY [ 0.063s]

writing 'logo'...

OKAY [ 0.125s]

finished. total time: 0.188s

C:\Program Files (x86)\Minimal ADB and Fastboot>fastboot flash boot boot.img

target reported max download size of 534773760 bytes

sending 'boot' (16384 KB)...

OKAY [ 0.492s]

writing 'boot'...

(bootloader) Image signed with key bad key

OKAY [ 0.375s]

finished. total time: 0.867s

C:\Program Files (x86)\Minimal ADB and Fastboot>fastboot flash recovery recovery.img

target reported max download size of 534773760 bytes

sending 'recovery' (20580 KB)...

OKAY [ 0.614s]

writing 'recovery'...

(bootloader) Image signed with key bad key

OKAY [ 0.484s]

finished. total time: 1.098s

C:\Program Files (x86)\Minimal ADB and Fastboot>fastboot flash system system.img_sparsechunk.0

target reported max download size of 534773760 bytes

sending 'system' (256355 KB)...

OKAY [ 7.384s]

writing 'system'...

(bootloader) Preflash validation failed

FAILED (remote failure)

finished. total time: 7.415s

C:\Program Files (x86)\Minimal ADB and Fastboot>fastboot flash system system.img_sparsechunk.1

target reported max download size of 534773760 bytes

sending 'system' (262115 KB)...

OKAY [ 7.538s]

writing 'system'...

OKAY [ 3.399s]

finished. total time: 10.937s

C:\Program Files (x86)\Minimal ADB and Fastboot>fastboot flash system system.img_sparsechunk.2

target reported max download size of 534773760 bytes

sending 'system' (259034 KB)...

OKAY [ 7.468s]

writing 'system'...

OKAY [ 3.535s]

finished. total time: 11.019s

C:\Program Files (x86)\Minimal ADB and Fastboot>fastboot flash system system.img_sparsechunk.3

target reported max download size of 534773760 bytes

sending 'system' (262013 KB)...

OKAY [ 7.507s]

writing 'system'...

OKAY [ 3.523s]

finished. total time: 11.046s

C:\Program Files (x86)\Minimal ADB and Fastboot>fastboot flash system system.img_sparsechunk.4

target reported max download size of 534773760 bytes

sending 'system' (262142 KB)...

OKAY [ 7.517s]

writing 'system'...

OKAY [ 3.387s]

finished. total time: 10.920s

C:\Program Files (x86)\Minimal ADB and Fastboot>fastboot flash system system.img_sparsechunk.5

target reported max download size of 534773760 bytes

sending 'system' (262140 KB)...

OKAY [ 7.492s]

writing 'system'...

OKAY [ 3.283s]

finished. total time: 10.775s

C:\Program Files (x86)\Minimal ADB and Fastboot>fastboot flash system system.img_sparsechunk.6

target reported max download size of 534773760 bytes

sending 'system' (259637 KB)...

OKAY [ 7.466s]

writing 'system'...

OKAY [ 3.293s]

finished. total time: 10.775s

C:\Program Files (x86)\Minimal ADB and Fastboot>fastboot flash system system.img_sparsechunk.7

target reported max download size of 534773760 bytes

sending 'system' (240915 KB)...

OKAY [ 6.953s]

writing 'system'...

OKAY [ 3.633s]

finished. total time: 10.617s

C:\Program Files (x86)\Minimal ADB and Fastboot>fastboot flash system system.img_sparsechunk.8

target reported max download size of 534773760 bytes

sending 'system' (262142 KB)...

OKAY [ 7.506s]

writing 'system'...

OKAY [ 3.650s]

finished. total time: 11.155s

C:\Program Files (x86)\Minimal ADB and Fastboot>fastboot flash system system.img_sparsechunk.9

target reported max download size of 534773760 bytes

sending 'system' (233189 KB)...

OKAY [ 6.672s]

writing 'system'...

(bootloader) Invalid sparse image data

(bootloader) Failed to flash sparse image

FAILED (remote failure)

finished. total time: 7.237s

C:\Program Files (x86)\Minimal ADB and Fastboot>fastboot flash system system.img_sparsechunk.10

target reported max download size of 534773760 bytes

sending 'system' (65436 KB)...

OKAY [ 1.890s]

writing 'system'...

(bootloader) Invalid sparse image data

(bootloader) Failed to flash sparse image

FAILED (remote failure)

finished. total time: 1.905s

C:\Program Files (x86)\Minimal ADB and Fastboot>fastboot flash oem oem.img

target reported max download size of 534773760 bytes

sending 'oem' (145482 KB)...

OKAY [ 4.172s]

writing 'oem'...

(bootloader) Preflash validation failed

FAILED (remote failure)

finished. total time: 4.172s

C:\Program Files (x86)\Minimal ADB and Fastboot>fastboot erase cache

erasing 'cache'...

OKAY [ 0.016s]

finished. total time: 0.016s

C:\Program Files (x86)\Minimal ADB and Fastboot>fastboot erase userdata

erasing 'userdata'...

OKAY [ 0.813s]

finished. total time: 0.813s

C:\Program Files (x86)\Minimal ADB and Fastboot>fastboot erase DDR

erasing 'DDR'...

OKAY [ -0.000s]

finished. total time: -0.000s

C:\Program Files (x86)\Minimal ADB and Fastboot>fastboot oem fb_mode_clear

...

OKAY [ -0.000s]

finished. total time: -0.000s

C:\Program Files (x86)\Minimal ADB and Fastboot>fastboot reboot