Knowledge of the spectrograph's instrumental profile (IP) provides important information needed for wavelength calibration and for the use in scientific analyses. This work develops new methods for IP reconstruction in high-resolution spectrographs equipped with astronomical laser frequency comb (astrocomb) calibration systems and assesses the impact that assumptions on the IP shape have on achieving accurate spectroscopic measurements. Astrocombs produce $ bright, unresolved emission lines with known wavelengths, making them excellent probes of the IP. New methods based on Gaussian process regression were developed to extract detailed information on the IP shape from these data. Applying them to HARPS, an extremely stable spectrograph installed on the ESO 3.6m telescope, we reconstructed its IP at 512 locations of the detector, covering 60<!PCT!> of the total detector area. We found that the HARPS IP is asymmetric and that it varies smoothly across the detector. Empirical IP models provide a wavelength accuracy better than ) with a 92<!PCT!> (64<!PCT!>) probability. In comparison, reaching the same accuracy has a probability of only 29<!PCT!> (8<!PCT!>) when a Gaussian IP shape is assumed. Furthermore, the Gaussian assumption is associated with intra-order and inter-order distortions in the HARPS wavelength scale as large as . The spatial distribution of these distortions suggests they may be related to spectrograph optics and therefore may generally appear in cross-dispersed echelle spectrographs when Gaussian IPs are used. Empirical IP models are provided as supplementary material in machine readable format. We also provide a method to correct the distortions in astrocomb calibrations made under the Gaussian IP assumption. Methods presented here can be applied to other instruments equipped with astrocombs, such as ESPRESSO, but also ANDES and G-CLEF in the future. The empirical IPs are crucial for obtaining objective and unbiased measurements of fundamental constants from high-resolution spectra, as well as measurements of the redshift drift, isotopic abundances, and other science cases.