I have found the solution to my particular problem now, but if someone else knows more about this feel free to improve my answer or post your own.
Annoyed with what I thought to be heimdall's fault, I turned to odin (not in a religious way).
This, however, gave me the same error. Close to desperation, I decided to check everything ...
I've figured it out. Besides the carrier-specific ROMs, Motorola has a "retail channel", called RETUS (Retail - US, I believe).
This is not tied to any carrier, and you can match the factory version by comparing with what you get here:
# fastboot getvar ro.build.fingerprint
(bootloader) ro.build.fingerprint: motorola/james/james:8.0.0/OPP27.9
You can try to boot directly into recovery instead of flashing image: fastboot boot recovery.img
If it doesn't work, go for flashing factory firmware in bootloader or Emergency Download mode. Here are the detailed instructions for Xiaomi devices.
When you changed the SD-card to your primary directory that made Android wanna boot from the SD-card because he thinks all of his files are there now. But ofc there are none of his files cuz they are all in /system on the internal storage. The only way to access the files is over adb (which probably isn't turned on if you always turn it off after finishing ...
This usually happens when the ROM is not installed properly, try flashing the factory image and start over the process again, install the latest vendor firmware(if there's one) and install the latest TWRP and then flash the ROM file, In my experience you don't have to wipe the internal storage every single time if your device is not encrypted, just the ...