Z-Buffer Values Problem with Camera

Hi all,
I try to get the zBuffer Values from my vtkRenderWindow with renWin->GetZbufferData(x1,y1,x2,y2) and it works fine, if I print the Image to file I get this :
But as soon as I add a Camera to my renderer it doesnt work anymore and I get this as result: zBufferInfo_withCamera
Can someone help me?
I used this example https://vtk.org/Wiki/VTK/Examples/Cxx/Utilities/ZBuffer

This is an issue with the near/far plane of your camera.
Try to call vtkRenderer::ResetCameraClippingRange()

still the same Problem even if I use vtkRenderer::ResetCameraClippingRange()
I have the following Setup:
camera->SetPosition(x, y, z);

Any idea?

I found a solution:
The camera position must be after renderWindow-> Render (); has been called.