In this paper, we show that HgCdTe heterostructures may support bound electronic states embedded in the continuum, such that the discrete energy spectrum overlaps the continuous spectrum. Although the proposed heterostructures are generally penetrable by an incoming electron wave, it is shown that they may support spatially localized trapped stationary states with an infinite lifetime. We discuss the possibility of a free electron being captured by the proposed open resonator, and present a detailed study of the trapping lifetime in the case of a detuned resonator.