IMO- The upgraded didn't corrupt things, installing 5.0.11 over a partially installed 5.0.12 probably hurt you the most. You really can't do that.
But that doesn't answer the question of what went wrong originally.
If you had installed 5.0.11 previously, and it installed fine...and then it was hanging on zimbra-core, my guess would be that something happened completely external to zimbra, where the package management (dbpkg) couldn't install it.
This is verified by the fact that you did a fresh install of your OS and it worked fine.
It might have been an update you installed on the system, or something as simple as a disk error that it was trying to recover from (ie a bad block).
Unfortunately, without the logs, we won't know.
My advice is to try upgrading to 5.0.12 again, and if it fails post the info here without taking evasive action. That way we can help.
john