@JTT,
I still think "was typing" is incorrect in this context, but I won't belabor the
issue. Certainly the sense is easily understood by most readers of English. I'd
argue more strenuously if we were discussing Latin.
"Had typed the wrong documents" doesn't sound to me as if he had finished,
only that the typing had occurred before another action in the past, "he
realized".