It could be from a number of different issues but two are very plausible one is persistent malware the other one is a corruption occuring on the flash chip by a improper software update or other type of damage that a security feature like verified boot or dm-verity would detect as unsigned, so ask yourself the following question very carefully:
Have you installed any apps outside trusted sources like the Google Play Store?
* — If yes - attempt to wipe the device from the recovery mode by navigating the available options displayed by holding down [Volume Down] + [Power] buttons while the phone is powered off. Hopefully the recovery partition is still intact, if this doesn't help try restoring the device with Motorola's official rescue tool https://youtu.be/TjsiGQkhVZ0
* — If no - it can be the result of damage to the eMMC in that case replacing the chip with a supported by the motherboard model/SKU **BY THE SAME OEM, WITH THE SAME PINOUT+DIMENSIONS ETC** and then attempting to flash the device **should** fix the issue. **Though sometimes the bootloader doesn't know where each partition should start and will refuse to write onto a clean chip, so making a raw copy of the partition layout and then copying it over onto the new chip and then resoldering it to the motherboard may be required**