Calibration assumes the pinhole model, right?
For this model an infinitesimal “pinhole” is assumed.
For that model of camera (pinhole) there is no such thing as focus.
(It has an infinte depth of field.)
I will argue with that drawing I made:
It shows the defocussing of a “real” pinhole camera with a real pinhole.
Now imagine the diameter of the hole getting infinitesimal small, so it converges into a single point. → Everything will be in focus.
That point is the optical center, assumed by the underlying pinhole model of the most calibration algorithms, including the one used in OpenCV.
P.S.: I changed my wording from “wrong” to “misleading”. Technically its not wrong, that chanig focus changes the intrinsics. Also Steve, and many other sources I have read, suggest taking pictures of your planar calibration target at different distances. But in order to do so, you are in need to refocus. (Or stop down your aperture, to increase depth of field.)