The short answer is that both values will be ‘incorrect’ in some way.
ICDD data is experimental, which means the lattice parameters are measured at a finite temperature (so thermal expansion is a factor), and are subject to other issues including impurities and growth conditions (for example, there may be grown-in strains related to choice of substrate etc.)
The Materials Project data is computational, meaning the lattice parameters are given at 0 K and are the lattice parameters of the ‘perfect’ crystal. But our computational data is calculated using a GGA exchange correlation functional (PBE), which typically overestimates the lattice parameter by 1-2%.
In your case, both HfC and HfN agree to less than 0.5% which is actually very good agreement.
The most important question in this case is not what the ‘true’ value of the lattice parameters is, but to what precision do you need to know the lattice parameter for your given application. If you need to know the lattice parameter accurate to < 0.5%, you will likely need to consider these other effects also such as strain, any impurity atoms or impurity phases present, growth conditions, and experiment temperature.