Let $S/k$ be a smooth variety and $A/S$ be an abelian scheme. Let $Z \hookrightarrow S$ be a reduced closed subscheme of codimension $\geq 2$.

I want to show that in this situation, $H^i_Z(S, A) = 0$ for $i \leq 2$ (étale cohomology).

Note that we have a long exact sequence

$\ldots \to H^i_Z(S, A) \to H^i(S, A) \to H^i(S \setminus Z, A) \to H^{i+1}_Z(S, A) \to \ldots$,

so for $i = 0$, this is equivalent to the injectivity of $H^0(S, A) \to H^0(S \setminus Z, A)$, which is clear since $A/S$ is separated, $S$ is reduced and $S \setminus Z \hookrightarrow S$ is dense. For $i = 1$ this is equivalent to $H^0(S, A) \to H^0(S \setminus Z, A)$ being surjective and $H^1(S, A) \to H^1(S \setminus Z, A)$ being injective. The surjectivity of $H^0(S, A) \to H^0(S \setminus Z, A)$ follows e.g. from [Bosch-Lutkebohmert-Raynaud, Néron models], p. 109, Thm. 1, which states that "Let $S$ be a normal noetherian base scheme, and let $u: Z \to G$ be an $S$-rational map from a smooth $S$-scheme $Z$ to a smooth and separated $S$-group scheme $G$. Then, if $u$ is defined in codimension $\leq 1$, it is defined everywhere." (Edit 2:) See also: [Milne in Cornell-Silverman, Abelian Varieties], Theorem 3.1.

For the injectivity of $H^1(S, A) \to H^1(S \setminus Z, A)$ and for $i = 2$ I don't have an idea.

Edit: For the injectivity of $H^1(S, A) \to H^1(S \setminus Z, A)$ and $i = 2$, one could use the interpretation of $H^1$ as torsors and $H^2$ as gerbes. Does the cited theorem of [Bosch-Lutkebohmert-Raynaud, Néron models] help in this case? What we need is:

If a principal homogeneous space $X/S$ for $A/S$ is trivial over $S \setminus Z$, then it is trivial over $S$.

Any principal homogeneous space $X/(S \setminus Z)$ extends to a principal homogeneous space $X/S$.

If a gerbe $X/S$ for $A/S$ is trivial over $S \setminus Z$, then it is trivial over $S$.

(Another idea would be to use purity, but see there some problems: We would need a /smooth/ pair $(S,Z)$ and finite coefficients.)