X-ray penetration in magnesium alloys is significant due to the low X-ray mass attenuation coefficient. To measure the surface residual stresses in magnesium alloys, a correction needs to be made to account for penetration depth. The residual stresses in as-received and shot peened AZ31B-H24 rolled sheet samples were measured using two-dimensional X-ray diffraction (2D-XRD) method. The electro-polishing layer removal method was used to find the residual stress pattern at the surface and through the depth. The results show that the corrected residual stresses in a few tens of micrometers layer from the surface differ from the raw stresses. To better estimate the residual stress distribution in the surface, the grazing-incidence X-ray diffraction (GIXD) technique was applied. Additionally, micrographs of the lateral cross-section of the peened specimens confirmed the presence of microcracks in this region, causing the residual stresses to vanish. Due to the low X-ray absorption coefficient of Mg alloys, this study shows how a small uncertainty in a single raw measurement leads to high uncertainty in the corrected residual stresses. The results were corroborated with the hole drilling method of residual stress measurements. The corrected X-ray diffraction (XRD) results are in close agreement with the hole drilling and GIXD results.