tl;dr: had a problem rooting on Android N, flashed stock M image. Now running unrooted M, but attempts to OTA upgrade to N fail. I'm unable to relock bootloader by reflashing stock. I think this is because Motorola doesn't want users to downgrade. How can I get back up to N?
For the past year I've been using Android 6.0.1 rooted on my Moto G4 Plus (XT1644), the US retail model. This weekend I wanted to upgrade to Android 7.0 and install the security patches.
I made backups of my phone using FlashFire (standard and fastboot), then followed this guide to return my phone to stock and relock the bootloader. It worked, and I was able to OTA update to Android N and install the latest security updates.
I still wanted root, so I unlocked the bootloader again, booted into TWRP, and flashed the Magisk zip. After doing this, the phone would not boot except to recovery.
Here's where I screwed up. I figured I could just start again, and tried to flash the same 6.0.1 stock image. It worked, and the phone is now running 6.0.1, but is unable to install OTA updates. Further, when I try to flash stock and relock the bootloader, fastboot warns me
(bootloader) Invalid signed image (bootloader) Preflash validation failed for most steps, and
(bootloader) Still require signed boot.img when I attempt to
fastboot oem lock. The same happens when I try to restore my FlashFire backup. I believe this is functionality to prevent users from downgrading, although I was able to revert to 6.0.1.
I can't find a stock Android N rom for XT1644, just an OTA udpate I'm unable to install. What steps can I take to get back to Android N, or to completely revert my phone to stock so I can upgrade again.