Post process depth rendering problem

I am trying to use a post material to render a depth image. It works for most of the objects/scenes. However, recently I found for some objects, I have no depth rendered (it has rendered textured). For example, the depth for the light pole is missing, while for other parts it looks correct. Does anyone have any clue on how to fix this? Thank you very much for your help.