In this article, we formulate and analyze a two-level preconditioner for optimized Schwarz and 2-Lagrange multiplier methods for PDEs with highly heterogeneous (multiscale) diffusion coefficients. The preconditioner is equipped with an automatic coarse space consisting of low-frequency modes of approximate subdomain Dirichlet-to-Neumann maps. Under a suitable change of basis, the preconditioner is a $2 \times 2$ block upper triangular matrix with the identity matrix in the upper-left block. We show that the spectrum of the preconditioned system is included in the disk having center $z=1/2$ and radius $r=1/2 - \epsilon$, where $0 < \epsilon < 1/2$ is a parameter that we can choose. We further show that the GMRES algorithm applied to our heterogeneous system converges in $O(1/\epsilon)$ iterations (neglecting certain polylogarithmic terms). The number $\epsilon$ can be made arbitrarily large by automatically enriching the coarse space. Our theoretical results are confirmed by numerical experiments.