I am studying the PN junction and I have learnt that in open circuit condition it has a built-in voltage (here called B) determined by the difference in fermi level of its n-doped and p-doped parts.

Then we can apply, for example, a forward bias, this will lower the voltage barrier, and therefore electrons can start flowing from n to p side, establishing a current.

If the forward bias is Va then we say in such condition the voltage across the depletion layer in the junction is B-Va.

The remaining part of the junction is said to be a neutral region with no voltage drop on it.

My question is: since we are applying Va with a voltage generator across the PN junction, but the voltage drop across the depletion layer is B-Va, and there is no voltage drop in any other point of the circuit, it seems to me that the second Kirchhoff's law is violated, as if I sum the voltage drops around this loop I won't get zero.

Far from me thinking that either the PN junction theory or Kirchhoff's law are wrong, what is the mistake I am doing in my considerations?

Thank you very much for any help in fixing this hole in my understanding