Beam stability is a crucial requirement for all particle accelerators. Coupled-bunch instability (CBI) is driven by beam interaction with narrowband impedance of the resonant accelerator components. Loss of Landau damping (LLD) for a single bunch is mainly determined by broadband impedance and can lead to undamped bunch oscillations. For the first time, we solve numerically the longitudinal stability problem in a self-consistent way for a general case of two impedance types and propose a simple analytical criterion describing how the obtained LLD and CBI thresholds are combined. We demonstrate that LLD can modify the CBI mechanism and reduce the instability threshold even below the LLD threshold. These findings allow the existing beam observations in CERN Super Proton Synchrotron and Large Hadron Collider to be explained and should be considered in design of the future accelerators. Published by the American Physical Society 2024