400 Series cameras can depth-sense up to 10 meters, so you are well within the maximum distance. The optimum resolution for depth sensing accuracy is the one that you are using, 1280*720. This is because as an object gets further away from the camera, accuracy can decrease when using low resolutions. So using a resolution of 848x400 or above is ideal.
Judging from past reports, 3 meters distance is the average distance when accuracy issues start setting in. So your report is consistent with those past reported results.
I assume that the camera is pointing downwards towards the ground instead of facing forwards as it hangs? This should not be a problem either, as RealSense cameras have been successfully orientated before in the downward-facing position.
May I ask if the camera is fully static, or if it is swaying around as it hangs? Or if the object it is scanning is moving?
The reason I asked about whether the object or camera was moving is that the D415 is not the best choice for projects with moving objects, as it is best at static scanning. The D435 is the model best suited to sensing during motion because of the 'global' type of camera shutter it has, rather than the 'rolling shutter' the D415 has. Since the camera and object are static in your test though, that does not seem to be the cause of the depth accuracy deviation.
What you could try is using the camera's Visual Preset settings to change the balance of the camera's configuration. By setting the 'High Accuracy' preset instead of the default one, you can emphasize accuracy at the cost of a lower 'fill factor'.
In the RealSense Viewer, you can change the preset to High Accuracy in the Presets drop-down menu.