Disconnecting the power and network cables before replacing a camera lens is crucial because there is a risk of short-circuiting the camera electronics. If the camera is powered on while the lens is being replaced, accidental contact with electronic components can cause a short circuit, potentially damaging the camera.