Gnats in Fresh Caulk Line on Crown Molding

I did an inspection on a home that had hundreds of microscopic gnats on the surface of the caulk between the ceiling and crown molding (see photo). The caulk was oily and all that I can figure is that the crown molding was painted before the caulking dried and the windows were left open to let the fumes out and there coincidently was a gnat hatch at the same time? Has anyone else seen such a thing? House 12 years old, in excellent condition with no signs of wood destroying insects. Very strange.