Suppose we have two different electric field, $\vec{E_1}$ and $\vec{E_2}$ where
$\vec{E_i}$ are elements of $\mathbb R^2$
$y>0 => \vec{E}$=$\vec{E_1} $ and
$y<0 => \vec{E}$=$\vec{E_2} $
Assume $\nabla \times\vec{E_i} = 0 $ and $\vec{E_i} = \nabla V_{i}(x,y)$
Suppose we calculate line integral along the closed loop, which is rectangle centered origin and whose height, h goes to 0.
What is work done here? In my opinion there must be net work done since the there exist two different fields and
$E_{1||}\times\Delta{x} \neq E_{2||}\times\Delta{x}$ in general where $ E_{i,normal}$ does not contribute to integral. But anyway we came to the point where we start, hence there is no change in potential.
I think there is a contradiction here, if there is no change in potential also there should be no net work done.
Could you kindly explain this?
Actually you are absolutelly right. It can be demonstrated (if you want I can give you some expressions) that if the parallel components to the boundary is different from zero, the field will have some work over particles on closed trayectories if $E_{1||}\ne E_{2||}$.
This solution is unphysical, in the sense that the field cannot provide work to particles moving on closed trayectories: The energy of the particle (or equivalentlly the potential), depends only on the position of the particle. This is the reason why, in this kind of boundaries the condition $E_{1||}=E_{2||}$ is imposed. I hope this will help you to clarify concepts!