The HUD and the gauge needle receive info from the PCM which is measuring pulses from the VSS. The discrepancy comes from the needle being off cal or the gauge markings not being perfectly accurate. The HUD will always be right since it displays it digitally.
Now, if you don't make adjustments, using a different rolling diameter tire will throw it off since it doesn't know that you changed anything.