Roughness influence on the residual stress gradient evaluation in the case of a grazing incidence X-ray diffraction setup is considered. In this geometry the surface roughness changes essentially the X-ray wave fields of the transmitted and diffracted beams inside the coatings and subsurface regions of bulk samples, and thus influences the refractive properties of the investigated sample area. In turn, the change in the refraction index enforces the re-scale of the informational depth and, consequently, the evaluated stress depth profile. The diffracted amplitude from the crystalline grain located beneath the surface is calculated. The surface roughness is shown to contribute into reconstruction of the real stress gradient profile of the coating.