We report the existence of latent order during core relaxation in the high-angle grain boundaries (GBs) of GaN films using atomic-resolution scanning transmission electron microscopy and ab initio density functional theory calculations. Core structures in the high-angle GBs are characterized by two pairs of Ga-N bonds located next to each other. The core type correlates strongly with the bond angle differences. We identify an order of core relaxation hidden in the high-angle GBs by further classifying the 5/7 atom cores into a stable 5/7 core (5/7(S)) and a metastable 5/7 core (5/7(M)). This core-type classification indicates that metastable cores can exist at real high-angle GBs under certain circumstances. Interestingly, 5/7(M) exhibits distinct defect states compared to 5/7(S), despite their similar atomic configurations. We investigate the reconstruction of defect states observed in 5/7(M) by analyzing the real-space wave functions. An inversion occurred between two localized states during the transition from 5/7(S) to 5/7(M). We suggest an inversion mechanism to explain the formation of new defect states in 5/7(M).