The thing is, when you rebase, you don't have A-B-C-D at all. If you have A-B-C and A-D and you rebase A-D onto A-B-C, you actually have A-B-C and A-B-C-D', where D' is the same diff as D, but it's a different revision. And when you build, you may find that D' doesn't work when D did.
Merging doesn't even help, because if you merge A-D to A-B-C, you end up with:
A-B-C-M
\_D_/
at which point M would be broken in the same cases where D' would be broken.
The point is M contains the fixes required to make A-B-C plus A-D build. Then you have no histories in that tree that don't compile.
Like you said, A-B-C-D' DOESN'T build, PRECISCELY because D' is the same diff as D. You need to make A-B-C-D'-M to get a working build, but the history A-B-C-D' is STILL BROKEN.
So you run a build on D', make the necessary fixes, and amend it. Which is exactly what you would have had to do with M anyway, or else M wouldn't build either. I don't see any difference at all.
Merge commits don't magically fix broken builds. All they do is ensure that you've resolved merge conflicts, but rebases do the same thing!
Merging doesn't even help, because if you merge A-D to A-B-C, you end up with:
at which point M would be broken in the same cases where D' would be broken.