In this study, we investigate the energy loss of highly charged ions interacting with various tungsten surfaces. The analysis primarily focuses on elucidating the impact of electron density distributions on energy loss of ions. Furthermore, we explore the correlation between surface azimuthal angles and energy loss under both uniform and inhomogeneous electron density distributions. Utilizing the classical over-the-barrier model (COBM), simulations involving trajectory calculations, energy loss, charge-exchange processes, and surface electron distributions, etc., were performed. Remarkably, the significant influence of axial channeling of surfaces on ion energy loss is observed. For the comparison of ion energy loss under uniform and inhomogeneous electron density distributions, the results reveal a more pronounced effect of electron density inhomogeneity on ion energy loss at higher energy-loss values. Additionally, the calculated energy-loss spectra of Ar16+ ions grazing on graphite surfaces show reasonable agreement with experimental data. These findings are crucial for understanding the surface structure of crystals.