Defocus Node - Compositor
The problem is the ID mask node. You blur your image and then crop it to the bounds of your object. so every pixel outside those boundaries get deleted.

I'd suggest adding the depth of field pre comp by adding the values for focus and aperture to your camera (you can often see the f-stop of the background image in the meta data, otherwise, just try and error).




Make sure, that your background is transparent by checking "transparent" in the film section of the render settings.



Then just add your object via an alpha over node to the background. Done.



If you do want to add DoF in the compositor, just skip the step with the camera settings, use the defocus node and the alpha over. Done (even quicker).