Lagrange theorem says only numbers $n \neq 4^n ( 8k+7)$ can be written as the sum of three squares. what about this one?
$$ 4= 2^2 + 0^2+ 0^2 $$
this looks acceptable to me, and yet it is excluded by Lagrange theorem.
https://en.m.wikipedia.org/wiki/Legendre%27s_three-square_theorem
It's not excluded; you cannot find $n$ and $k$ so that $4 = 4^n(8k + 7)$.