Context. The Kepler mission has discovered that close-in super-Earth planets are common around solar type stars. They are often seen together in multiplanetary systems, but their period ratios do not show strong pile-ups near mean motion resonances (MMRs). One scenario is that super-Earths form early, in the presence of a gas-rich disk. Such planets interact gravitationally with the disk gas, inducing their orbital migration. Disk migration theory predicts, however, that planets would end up at resonant orbits due to their differential migration speed. Aims. Motivated by the discrepancy between observation and theory, we seek for a mechanism that moves planets out of resonances. We examine the orbital evolution of planet pairs near the magnetospheric cavity during the gas disk dispersal phase. Our study determines the conditions under which planets can escape resonances. Methods. We extend Type I migration theory by calculating the torque a planet experiences at the interface of the empty magnetospheric cavity and the disk: the one-sided torque. We perform two-planet N-body simulations with the new Type I expressions, varying the planet masses, stellar magnetic field strengths, disk accretion rates and gas disk depletion timescales. Results. As planets migrate outward with the expanding magnetospheric cavity, their dynamical configurations can be rearranged. Migration of planets is substantial (minor) in a massive (light) disk. When the outer planet is more massive than the inner planet, the period ratio of two planets increases through outward migration. On the other hand, when the inner planet is more massive, the final period ratio tends to remain similar to the initial one. Larger stellar magnetic field strengths result in planets stopping their migration at longer periods. We apply this model to two systems, . By fitting their present dynamical architectures, the disk and stellar B-field parameters at the time of disk dispersal can be retrieved. Conclusions. We highlight Magnetospheric rebound as an important ingredient able to reconcile disk migration theory with observations. Even when planets are trapped into MMR during the early gas-rich stage, subsequent cavity expansion would induce substantial changes to their orbits, moving them out of resonance.