Motion tracking. The edges of undistorted footage are cropped, and so are the elements of the 3D scene
The problem:

Undistorted footage the pixels no longer correspond with the original frame size.

The image is being stretched past the limits of the original frame, so the undistorted result will be cropped.



A possible solution would be to render a proxy undistorted plate that has the complete undistorted information, to do this you need is much larger canvas than the original footage. Change Dimensions>Render Resolution until you can see all of the image gloriously undistorted:



Use that undistroted proxy to do the motion tracking, camera solution and 3d elements for the scene.

EDIT:

Then render the undistorted 3D elements as as separate plate before compositing.



Import the new element into the compositor and use the Movie Distortion node in Distor mode using the information from the original clip, and composite with alpha over on the undistorted original.



At this point you can go back to the original frame size in the resolution.