The James Webb Space Telescope (JWST) will provide an opportunity to investigate the atmospheres of potentially habitable planets. Aerosols significantly mute molecular features in transit spectra because they prevent light from probing the deeper layers of the atmosphere. Earth occasionally has stratospheric/high tropospheric clouds at 15–20 km that could substantially limit the observable depth of the underlying atmosphere. We use solar occultations of Earth’s atmosphere to create synthetic JWST transit spectra of Earth analogues orbiting dwarf stars. Unlike previous investigations, we consider both clear and cloudy sightlines from the SCISAT satellite. We find that the maximum difference in effective thickness of the atmosphere between a clear and globally cloudy atmosphere is 8.5 km at 2.28 $\mu$m, with a resolution of 0.02 $\mu$m. After incorporating the effects of refraction and Pandexo’s noise modelling, we find that JWST would not be able to detect Earth-like stratospheric clouds if an exo-Earth was present in the TRAPPIST-1 system, as the cloud spectrum differs from the clear spectrum by a maximum of 10 ppm. These stratospheric clouds are also not robustly detected by TauREx when performing spectral retrieval for a cloudy TRAPPIST-1 planet. However, if an Earth-sized planet were to orbit in a white dwarf’s habitable zone, then we predict that JWST’s NIRSpec would be able to detect its stratospheric clouds after only four transits. We conclude that stratospheric clouds would not impede JWST transit spectroscopy or the detection of biosignatures for Earth-like atmospheres.