Example 2 Let integers $x, y, z$ satisfy
$$
\left\{\begin{array}{l}
|x+y|+|y+z|+|z+x|=4, \\
|x-y|+|y-z|+|z-x|=2 .
\end{array}\right.
$$

Find the value of $x^{2}+y^{2}+z^{2}$.
Let's assume $x \leqslant y \leqslant z$.
Then from equation (2) we get
$$
\begin{array}{l}
(y-x)+(z-y)+(z-x)=2 \\
\Rightarrow z=x+1 \Rightarrow x \leqslant y \leqslant x+1 \\
\Rightarrow y=x \text { or } y=x+1 .
\end{array}
$$
(1) When $y=x$, from equation (1) we get
$$
\begin{array}{l}
|x|+|2 x+1|=2 \\
\Rightarrow x=-1, y=-1, z=0 \\
\Rightarrow x^{2}+y^{2}+z^{2}=2 .
\end{array}
$$
(2) When $y=x+1$, from equation (1) we get
$$
\begin{array}{l}
|2 x+1|+|x+1|=2 \\
\Rightarrow x=0, y=1, z=1 \\
\Rightarrow x^{2}+y^{2}+z^{2}=2 .
\end{array}
$$

In summary, $x^{2}+y^{2}+z^{2}=2$.