ShaderPipeline: Overlay Flag Handling Buggy

The shader pipeline renderer supports the overlay flag of render objects. If it is set, the object is rendered in a second pass above everything of the first pass. This sort of works, but not always.
The following screen shots show one good case and one failure case:

If I had to guess, I'd say it is some issue with the Z-Buffer. Maybe it's not cleared properly before the second pass?