One M9 flash system image Situation
Device: HTC One M9
Recovery: TWRP
Custom ROM: Android Revolution HD (Android 6.0)

Problem
I want to flash the stock rom without wiping anything (I don't want to lose anything). I can flash the stock recovery. I have extracted the system.img and boot.img from the official RUU in order to flash the system image to get rid of the Custom ROM.
When I use fastboot to flash the boot image everything seems fine.
However, when I flash the system image which is about 4.5 gigs big, it again says OK but it only takes around 30 seconds to flash.
When I try to boot after flashing the images, the htc logo appears but nothing more happens. Trying to install an OTA with the stock recovery fails with 
"system partition has unexpected contents".
I assume that the flashing process wasn't really successful.

How can I correctly flash the system partition?
Or is there any other way to get back to the stock rom without wiping userdata?
And NO, it's not acceptable in any way to wipe (I know that aprox. 98% of android enthusiasts would answer: "Just wipe".)

Btw. the reason for all of this is that the custom rom might not be updated to android 7 so i want to install the ota.

[edit]:
I use htc's fastboot version since the system image is 4.5g big and it cannot be flashed with normal fastboot.
Usually large images are flashed in sparse (parts). To flash a full image that large, consider using the dd command in a shell to directly write the image to /system - that's the only approach I can think of that doesn't seem to have size issues.

[edit]:
dd worked (booted to twrp and opened adb shell):
dd if=/external_sd/system.img of=/dev/block/mmcblk0p66
where mmcblk0p66 is the system partition (in /dev/block/platform/&lt;something&gt;.sdhci/by-name you can find a list of all partitions)