What's the difference between the Undistortion node and the "Render undistorted"option in the camera background settings?
The camera background image in the viewport, with Render Undistorted option enabled,

should look the same as the result of the &quot;undistort node&quot; in the compositor,

and same as when you check the &quot;render undistorted&quot; in the Clip Display options in the Movie Clip editor.

In the undistorted image, straight lines should look straight, not curved. If they don't, then the Radial distortion coefficients k1, k2 (and k3) are not set correctly, or the optical center of the image might be incorrect as well.
To determine the distortion coefficients photograph a chart (or anything that has straight lines), open the image in the movie clip editor and use the annotation tool to trace thosestraight lines and distort them to match the image as shown in the following link:
How to determine lens undistortion values for motion tracking?