.Being (essentially) unable to lie and easily outmaneuvered in social situations, coupled with a fierce expectation of fairness and absolutely zero ******** tolerance level makes for poor office politics ability!! But eventually found a workaround. It'll drive you nuts doing it, but it works.
--Do exactly as you described above when questioned. "I'll explain exactly that: what was not properly done, and what steps I took to fix it, how much more time it took compared to what was scheduled (you know, before somebody went and ruined things), etc." BUT THEN add "But its partly my fault. I should have [made-up minor mistake you made, such as "I stupidly thought X would be a fix, but it was a waste of time" or "I should've noticed sooner" or "I thought I could get finished more quickly", etc.]. Make sure you've explained the situation in detail, then admit to some minor mistake, and apologize profusely for the error.
99 times out of 100, the boss will say "no no, it's okay, you did the best you could, you inherited this mess" etc. An example: let's say I'm working on a project that wasn't finished on time because Jimmy did a lousy, sloppy job on the part he worked on, and I had to fix all his mistakes. I'd say "It was tough because part X [Jimmy's responsibility, as the boss will know] was so poorly written I had to revise the whole thing, which took almost two days. But it's my fault because I should've reviewed part X before I went home Monday night [when you worked late with the boss until 9pm, as the boss also knows] instead of first thing Tuesday morning. If I had looked at it Monday night, I could've worked through the night to meet the deadline. It's my fault, really." You gotta act really remorseful, almost disgusted with yourself.
Thusly, you clearly place the blame where it belongs without naming any names, then look like a great guy/gal by taking responsibility for something clearly beyond your control, and you're quickly forgiven for your minor transgression.
Of course it did take me around 15 years to figure this out!