Correction to: Nature Astronomy https://doi.org/10.1038/s41550-020-1050-2, published online 06 April 2020.

In the version of this Letter originally published, the standfirst erroneously included the text ‘The exoplanet atmospheres we study may not be primary atmospheres. Models show that the accretion of gas late in a planetary system’s formation may completely replace the primary atmospheres of terrestrial planets. These secondary atmospheres are likely to have high metallicities and high C/O ratios.’ This has now been corrected.