Change `camera.position` to `camera.getPositionWC()`.  When the camera is following an object, its position is only a few kilometers away.  You need `getPositionWC()` to convert that small number to world coordinates, otherwise it thinks you're near the center of the Earth.