  The stochastic cosmological gravitational-wave background (CGWB) provides a
direct window to study early universe phenomena and fundamental physics. With
the proposed third-generation ground-based gravitational wave detectors,
Einstein Telescope (ET) and Cosmic Explorer (CE), we might be able to detect
evidence of a CGWB. However, to dig out these prime signals would be a
difficult quest as the dominance of the astrophysical foreground from
compact-binary coalescence (CBC) will mask this CGWB. In this paper, we study a
subtraction-noise projection method, making it possible to reduce the residuals
left after subtraction of the astrophysical foreground of CBCs, greatly
improving our chances to detect a cosmological background. We carried out our
analysis based on simulations of ET and CE and using posterior sampling for the
parameter estimation of binary black-hole mergers. We demonstrate the
sensitivity improvement of stochastic gravitational-wave searches and conclude
that the ultimate sensitivity of these searches will not be limited by
residuals left when subtracting the estimated BBH foreground, but by the
fraction of the astrophysical foreground that cannot be detected even with
third-generation instruments, or possibly by other signals not included in our
analysis. We also resolve previous misconceptions of residual noise in the
context of Gaussian parameter estimation.
