  Stochastic gravitational-wave backgrounds can be of either cosmological or
astrophysical origin. The detection of an astrophysical stochastic
gravitational-wave background with ground-based interferometers is expected in
the near future. Perhaps even more excitingly, the detection of stochastic
backgrounds of cosmological origin by future ground-based interferometers could
reveal invaluable information about the early Universe. From this perspective,
the astrophysical background is a {\it foreground} that can prevent the
extraction of this information from the data. In this paper, we revisit a
time-frequency domain notching procedure previously proposed to remove the
astrophysical foreground in the context of next-generation ground-based
detectors, but we consider the more realistic scenario where we remove
individually detectable signals by taking into account the uncertainty in the
estimation of their parameters. We find that time-frequency domain masks can
still efficiently remove the astrophysical foreground and suppress it to about
$5\%$ of its original level. Further removal of the foreground formed by
unresolvable events (in particular, unresolvable binary neutron stars), which
is about $10$ times larger than the residual foreground from realistic
notching, would require detector sensitivity improvements. Therefore, the main
limitation in the search for a cosmological background is the unresolvable
foreground itself, and not the residual of the notching procedure.
