We study the possible effects of selection biases on the correlation caused by the unavoidable presence of flux limits in the existing samples of gamma-ray bursts (GRBs). We consider a well-defined complete sample of Swift GRBs and perform Monte Carlo simulations of the GRB population under different assumptions for their luminosity functions. If we assume that there is no correlation between the peak energy Epeak and the isotropic luminosity Liso, we are unable to reproduce it due to the flux limit threshold of the Swift complete sample. We can reject the null hypothesis that there is no intrinsic correlation between Epeak and Liso at more than 2.7σ level of confidence. This result is robust against the assumptions of our simulations and it is confirmed if we consider, instead of Swift, the trigger threshold of the BATSE instrument. Therefore, there must be a physical relation between these two quantities. Our simulations seem to exclude, at a lower confidence level of 1.6σ, the possibility that the observed Epeak–Liso correlation among different bursts is caused by a boundary, i.e. such that for any given Epeak, we see only the largest Liso, which has a flux above the threshold of the current instruments.