Let F be a vector field on a bounded domain $V \subset \mathbb{R}^3$, which is twice differentiable, let $S := \partial V$.
According to the Helmholtz Theorem, F can be decomposed, such that:
$$ \mathbf{F} = -\nabla \Phi + \nabla \wedge \mathbf{A} $$ , where
$$ \Phi (\mathbf{x}) = \frac{1}{4\pi} \int_V {\nabla ' \mathbf{F}(\mathbf{x} ') \over |\mathbf{x} - \mathbf{x}'|}dV' - \frac{1}{4 \pi} \oint_S {\langle \mathbf{n}', \mathbf{F}(\mathbf{x} ') \rangle \over | \mathbf{x} - \mathbf{x}' |}dS' \\ $$ $$ \mathbf{A} (\mathbf{x}) = \frac{1}{4\pi} \int_V {\nabla ' \wedge \mathbf{F}(\mathbf{x} ') \over |\mathbf{x} - \mathbf{x}'|}dV' - \frac{1}{4 \pi} \oint_S { \mathbf{n}' \wedge \mathbf{F}(\mathbf{x} ') \over | \mathbf{x} - \mathbf{x}' |}dS' $$
Applying this for instance to the static Maxwell's equations: $$ \mathbf{E}(\mathbf{x} ) = -\nabla \Phi (\mathbf{x}) $$ $$ \nabla \mathbf{E}(\mathbf{x} ) = {\rho( \mathbf{x} ) \over \epsilon_0 } $$
we obtain:
$$ \Phi (\mathbf{x}) = \frac{1}{4\pi\epsilon_0} \int_V { \rho(\mathbf{x} ') \over |\mathbf{x} - \mathbf{x}'|}dV' + \frac{1}{4 \pi} \oint_S \frac{\langle \mathbf{n}', \nabla ' \Phi(\mathbf{x} ') \rangle}{| \mathbf{x} - \mathbf{x}' |}dS' \\ $$
Using Green's second identity, we can obtain a similiar result:
$$ \Psi(\mathbf{x} ) = {1 \over 4\pi } \int_V { 1 \over | \mathbf{x} - \mathbf{x} ' |} \Delta \Psi(\mathbf{x} ') dV' + {1 \over 4\pi } \oint_{S} { \langle \mathbf{n '} (\mathbf{x} ' ), \nabla ' \Psi(\mathbf{x} ' ) \rangle \over | \mathbf{x} - \mathbf{x} ' | } dS' - {1 \over 4\pi } \oint_{S} \Psi(\mathbf{x} ') \langle \mathbf{n '} (\mathbf{x} ' ), \nabla ' { 1 \over | \mathbf{x} - \mathbf{x} ' | } \rangle dS' $$ $$ \Psi(\mathbf{x} ) = {1 \over 4\pi\epsilon_0} \int_V { \rho(\mathbf{x} ') \over | \mathbf{x} - \mathbf{x} ' | } dV' + {1 \over 4\pi } \oint_{S} { \langle \mathbf{n '} (\mathbf{x} ' ), \nabla ' \Psi(\mathbf{x} ' ) \rangle \over | \mathbf{x} - \mathbf{x} ' | } dS' - {1 \over 4\pi } \oint_{S} \Psi(\mathbf{x} ') \langle \mathbf{n '} (\mathbf{x} ' ), \nabla ' { 1 \over | \mathbf{x} - \mathbf{x} ' | } \rangle dS' $$
I'm bothered by the additional term in the second variant.
At the first glance the different variants do not have to contradict since the potential of a field is not uniquely determined without additional conditions imposed. But for a given field $E: V\subset \mathbb{R}^3 \rightarrow \mathbb{R}^3$, $E = - \nabla \Phi = - \nabla \Psi$ implies that $$ 0 = {1 \over 4\pi } \nabla \oint_{S} \Psi(\mathbf{x} ') \langle \mathbf{n '} (\mathbf{x} ' ), \nabla ' { 1 \over | \mathbf{x} - \mathbf{x} ' | } \rangle dS' $$
However, this does not seem to be true in general (take a potential that is constant ($\neq 0$) on $\partial V$ for instance).
What am I missing here?