<sec>How to effectively control the refraction, reflection, propagation and wavefront of electromagnetic wave or light is always one of the advanced researches in the field of optics. In recent years, much effort has been devoted to both theoretical and experimental studies of optical phase gradient metagratings (PGMs) due to the fundamental interest and practical importance of PGMs, such as the generalized Snell’s law (GSL). Typically, the PGMs are constructed as periodic gratings consisting of a supercell spatially repeated along an interface, and each supercell consists of <i>m</i> unit cells, with <i>m</i> being an integer. The key idea of PGMs is to introduce an abrupt phase shift covering the range from 0 to <inline-formula><tex-math id="M2">\begin{document}$2\pi $\end{document}</tex-math><alternatives><graphic xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="2-20221696_M2.jpg"/><graphic xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="2-20221696_M2.png"/></alternatives></inline-formula> discretely through <i>m</i> unit cells to ensure the complete control of the outgoing waves. The phase gradient provides a new degree of freedom for the manipulation of light propagation, which has allowed a series of ultrathin devices to realize anomalous scattering, the photon spin Hall effect, and many other phenomena.</sec><sec>Intuitively, the number of unit cells <i>m</i> in a supercell does not influence the PGM diffraction characteristics, except that a small value of <i>m</i> will lead to a reduced diffraction efficiency. However, some recent studies have shown that the integer <i>m</i> plays a fundamental role in determining the high-order PGM diffractions when the incident angle is beyond the critical angle predicted by the GSL. In particular, for high-order PGM diffractions, <i>m</i> leads to a new set of diffraction equations expressed as</sec><sec> <inline-formula><tex-math id="M3">\begin{document}$ \left\{ {\begin{aligned} &{{k_x} = k_x^t - nG,{\text{ for odd L,}}} \\ &{{k_x} = k_x^r - nG,{\text{ for even L}}{\text{. }}} \end{aligned}} \right. $\end{document}</tex-math><alternatives><graphic xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="2-20221696_M3.jpg"/><graphic xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="2-20221696_M3.png"/></alternatives></inline-formula></sec><sec>In addition to the phase gradient, the integer number of unit cells <i>m</i> in a supercell is another degree of freedom that can be employed to control the light propagation. By the parity of <i>m</i>, the higher-order outgoing wave can be reversed between the anomalous transmission channel and the anomalous reflection channel.</sec><sec>In this work, according to the concept of abrupt phase and the parity-dependent diffraction law in phase gradient metagrating, we theoretically design and study an optical meta-cage. The meta-cage is a periodic structure with one period that contains <i>m</i> different unit cells. Through numerical simulations and rigorous analytical calculations, we find that the ability of meta-cage to trap light is related to the parity of the number of unit cells <i>m</i> in a supercell. Specifically, when the number of unit cells is odd, the point source placed in the meta-cage can perfectly radiate out of the meta-cage without any reflection. On the contrary, when the number of unit cells is even, the point source can hardly radiate out of the meta-cage, and all the energy is localized within the meta-cage. Moreover, such a phenomenon is robust against the disorder. These results can provide new ideas and theoretical guidance for designing new radar radome and photonic isolation devices.</sec>