# Adding a surface term to Dirac action modifies the canonical anticommutation relations [duplicate]

I'm dealing with the following issue: when describing a fermionic field, one can use the typical Dirac Lagrangian $$\mathcal{L}=\bar\psi(i\gamma^\mu\partial_\mu-m)\psi,\tag{1}$$ or the more symmetric one $$\mathcal{L}=\bar\psi\left(\frac{i}{2}\gamma^\mu\overleftrightarrow{\partial_\mu}-m\right)\psi,\tag{2}$$ which differs from the previous one by one surface term, so they should describe the same dynamics. My question is the following: if I calculate the canonical momentum using the Lagrangian $$(1)$$, I obtain $$\Pi=\frac{\partial\mathcal{L}}{\partial(\partial_0\psi)}=i\bar\psi\gamma^0=i\psi^\dagger,$$ so the canonical anticommutation relation $$\{\psi(t,\,\vec{x}),\;\Pi(t,\,\vec{y})\}=i\delta(\vec{x}-\vec{y})$$ reads $$\boxed{\{\psi(t,\,\vec{x}),\;\psi^\dagger(t,\,\vec{y})\}=\delta(\vec{x}-\vec{y}).}$$

If instead I use the Lagrangian $$(2)$$, the canonical momentum reads $$\Pi=\frac{\partial\mathcal{L}}{\partial(\partial_0\psi)}=\frac{i}{2}\bar\psi\gamma^0=\frac{i}{2}\psi^\dagger,$$ yielding thus the following anticommutation relation between $$\psi\text{ and }\psi^\dagger$$ $$\boxed{\{\psi(t,\,\vec{x}),\;\psi^\dagger(t,\,\vec{y})\}=2\delta(\vec{x}-\vec{y}).}$$

As you can see, there is an extra factor of 2. This is weird for me, because since both Lagrangians are equivalent I expected a fundamental object such as an anticommutation relation to be invariant, but clearly (unless I did something wrong) it is not. Can someone shed some light on this?