@runcyclexcski the thread is not M12, it is about 8.5mm diameter over the threads, which is larger than the Pi Camera V2 which is about 6mm diameter.
The flat field and colour correction for the Pi Camera 2 are handled by the OpenFlexure server software for the microscope, but there are remaining colour saturation issues caused by the lenslet array, as discussed in recent threads:
Focusing and Chromatic Aberration Issues,
First build, basic low cost microscope v7.0.0-beta1 - #10 by Yashka,
and Investigating tube lenses for infinity optics, RPi HQ camera, and a simple upright microscope
I have not yet tested the Pi Camera Module 3 as it is not yet supported by the software, but I would expect it to have similar effects to the Pi Camera 2 because it is a wide sensor with a short focal length lens. The Pi HighQ camera is much better in these respects. You can also get a version for M12 lenses which might help you.