There are a few factors at play here.
- Focal length specifications on lenses will always only be "approximate". Specifically in the case of a M12 lens, focal length usually changes slightly with focus when the lens is screwed in and out of its threaded holder.
- I would also not expect the pixel size specification to be accurate to more than 5%, especially not in uncontrolled temperature environment.
- The focal length will often be correlated with distortion parameters. I.e. focal length may be smaller than nominal and distortion estimated to compensate for that.
Calib.io has the Calibrator program, which lets you investigate whether such parameter correlations exist, and lets you obtain a best fit linear camera model, estimating an "effective focal length" comparable to what you achieve experimentally.
Further, Calibrator lets you analyse whether the remaining rpe is due to un-modelled lens behaviour (bad), or only due to unbiased image noise (harmless).