Changing the camera used by a depth renderer is not really supported, because a depth renderer is strongly linked to a camera (internally, we keep an association between a camera and its depth renderer).
In your case, you can set depthRenderer._camera = camera to make it work, but we don’t promise it won’t break in newer releases of Babylon:
The problem is that both depth renderers generate their map each frame, even the depth renderer of the camera which is not active. You should do as in https://www.babylonjs-playground.com/#1ST43U#444 and disable the depth renderer for the non active camera.
Note that it’s straightforward to do it with a frame graph:
However, rebuilding the graph each time the camera changes can be a bit taxing because the shadow generator (among other objects) will be disposed/recreated each time.
It’s more performant to just update the camera for the tasks that use it: