# Why doesn't the work function being sensitive to surface not break the conservation of energy?

I understand that the work function is sensitive to the surface. But I don't understand how that doesn't violate energy conservation given the following scenario:

Suppose there are two electrons at the Fermi level. A photon comes in with energy $$\hbar\omega$$ and hits one of these electrons. The photon had momentum such that the electron goes off in a certain direction and through surface A, thereby it has kinetic energy $$\hbar\omega - φ_A$$ and has potential energy $$E_{vac}$$. Now another photon comes in, with equal energy, but momentum in a different direction such that the electron it hits is sent off in a different direction so it leaves the crystal through surface B. Now this electron has kinetic energy $$\hbar\omega - φ_B$$ and has the same potential energy of $$E_{vac}$$. Does conservation of energy not require that the two work functions are therefore equal?

i.e. the two electrons start in the same state, are both excited by photons of equal energy, then both finish at the vacuum level but supposedly have different energies due to the particular surface that they were ejected through.

The resolution to this paradox is realizing that the electrons are originating from two different initial states, one photo-emitted from surface A, $$\vert \psi_A\rangle$$, and the other surface B, $$\vert \psi_B\rangle$$. Because the initial states for your two scenarios are different, they naturally have different binding energies (i.e. different starting potential energies) so you expect they will have different kinetic energies after photoemission as well. Thus, there is no violation of energy conservation.