When you do the ground state calculation, you choose a k-point mesh to numerically integrate the states over the Brillouin zone. This is an approximation, but a controllable one; if you increase the number of k-points in the ground state calculation, the Fermi energy will eventually converge.
A band-structure calculation involves calculating the Kohn-Sham states at special high-symmetry points and lines, which are specifically chosen to capture the maxima and minima of the states. These are atypical points and terrible as sampling points, so any properties calculated from them are unlikely to be accurate -- this includes the Fermi energy.
There is a very similar, related case where the second calculation is not a band-structure but a density-of-states (DOS). In this case, the DOS is performed at a good set of sampling points, in fact they are usually a much better sampling mesh than the original ground state calculation. This will usually give a different Fermi energy as well, but in this case the difference is due to finite k-point sampling error. The value from the DOS is probably more accurate, but if you care about the difference then you should probably refine the original ground state calculation with more k-points.