Hervé explained it best here
https://osxlatitude.com/forums/topic/8723-enabling-dvidphdmi-and-increasing-vram-with-intel-haswell4th-gen-hd420044004600etc-igpu/?page=1
Your internal monitor is on port #6 FB@1, while HDMI is on port #5 FB@0, hence why I patched port #5, changing the priority from 09 to 12 (known issue on some Haswell when external monitors are connected).
You're thinking of FB@0, port 0 like a laptop, but in your system port 0 is at FB@2, same as on the real IMac.
Post your debug file