How did Cassini pull off measurements of the sun’s size, since the apparent size of the sun will change due to atmospheric conditions?
As I am not an astronomer I looked up the question
Is there a correlation between the maximum magnification of Earth's atmospheric lens and the apparent diameter of the Sun and the Moon?Atmospheric refraction doesn’t magnify, it reduces, and only in altitude. It’s strongest on the horizon, where it lets us see celestial objects up to about 1/2° below the geometric horizon; thus it reduces a 181° arc to an apparent 180° from horizon to horizon. The strength of the refraction varies non-linearly with altitude, from zero at the zenith to about 1′ (1 arc-minute) at 45°elevation, to a mean of 35.4′ on the horizon. The exact deviation varies slightly with atmospheric temperature and pressure.
When the Moon or Sun are on the horizon they appear slightly flattened due to the increasing amount of refraction from top to bottom, but their apparent widths are unaffected. Away from the horizon, the only significant impact of atmospheric refraction is that astronomical altitude angle measurements have to be corrected, depending on altitude. Azimuth measurements are unaffected.
Now if anyone knew about refraction it was Cassini:

In the years that followed, Cassini produced an astonishing number of observations, always improving the known data with better accuracy. As an example of Cassini’s genius, and how he revolutionised astronomy, let us read how he overcame the astronomical problem of refraction:
‘In order to establish the principles of astronomy in a solid manner, the Academy judged that before everything else it was necessary to distinguish false appearances from the true ones. The ancients had supposed that the rays of stars came in a straight line to our eye. It had been well noticed for about a century that this supposition does not tally with the observations, and it was recognised that the rays break up on passing through the ether in the air that surrounds the Earth. This ‘refraction’ makes stars appear higher than they really are, and that near the horizon it raises the sun and the moon more than the size of their diameters. But the most famous modern astronomers were still mistaken in that having remarked that the refractions become smaller to the measure as the heights get bigger, it was supposed that the refractions of the fixed stars become faded at the height of thirty degrees and those of the Sun at height of forty-five degrees. The academy discovered by making many very exact observations that the refractions both of the sun and of the fixed stars are still very perceptible at the height of forty-five degrees; that they are the same by day as by night; that they are not different for the Sun and for the stars; that they only become perceivable at the zenith; that it is therefore necessary to correct all the apparent heights of the stars, and even to lessen the heights of the Pole [star]. For even though the ancients had never made a distinction between the heights of the apparent Poles and the true ones, nevertheless it is a fact that the heights of the Poles appear in our climes to be bigger by a few minutes than they really are: whence it follows that up to now there has been error in all of the astronomic calculations based on the height of the Pole, and as there are few observations which do not suppose the height of the Pole, there are thus only a few (observations) that do not require correction.’--- J. D. Cassini.