Global, population-wide oscillations in models of cyclic dominance may result in the collapse of biodiversity due to the accidental extinction of one species in the loop. Previous research has shown that such oscillations can emerge if the interaction network has small-world properties, and more generally, because of long-range interactions among individuals or because of mobility. But although these features are all common in nature, global oscillations are rarely observed in actual biological systems. This begets the question what is the missing ingredient that would prevent local oscillations to synchronize across the population to form global oscillations. Here we show that, although heterogeneous species-specific invasion rates fail to have a noticeable impact on species coexistence, randomness in site-specific invasion rates successfully hinders the emergence of global oscillations and thus preserves biodiversity. Our model takes into account that the environment is often not uniform but rather spatially heterogeneous, which may influence the success of microscopic dynamics locally. This prevents the synchronization of locally emerging oscillations, and ultimately results in a phenomenon where one type of randomness is used to mitigate the adverse effects of other types of randomness in the system.