From A History of Mathematics by Carl Boyer:
In 200-300 BC, Aristarchus “derived the conclusion that 1/20 < sin 3-degrees < 1/18, hence he asserted that the sun is more than eighteen, but less than twenty, times as far from Earth as is the moon. This is far from modern value–somewhat less than 400 times–but is better than the values nine and twelve that Archimedes ascribed respictively to Eudoxus and Phidias (Archimedes’ father). Moreover, the method used by Aristarchus was unimpeachable, the result being vitiated only by the error of observation in measuring the angle MES as 87-degrees (sin 3), when in actuality it should have been about 89.2 degrees (sin 0.8).”
Basically, he messed up on the distance of the moon and sun because he inaccurately measure the angles. Something to emphasize to the students when measuring angles precisely to relate to real world phenomena, especially those involving large numbers.