$ \newcommand{\R}{\mathbb{R}} \newcommand{\la}{\lambda} \newcommand{\p}{\partial} \newcommand{\PP}{\mathcal{P}}$ Let $x:=(x_1,\dots,x_n)\in[0,1]^n$, $y:=(y_1,\dots,y_n)\in[0,1]^n$, $h:=(h_1,\dots,h_n)$, \begin{equation*} h_i:=H(x_i,y_i),\quad H(s,t):=\frac2{\frac1s+\frac1t}=\frac{2st}{s+t} \end{equation*} for $s>0$ and $t>0$, and, by continuity, $H(s,t):=0$ for $s\ge0$ and $t\ge0$ with $s t=0$. Let $Az:=\frac1n\sum_1^n z_i$ for $z:=(z_1,\dots,z_n)$. Then the result in question can written as \begin{equation*} L:=L(x,y):=H(Ax,Ay)-Ah\le L^*_n:= \left\{ \begin{alignedat}{2} &\frac12&&\text{ if $n$ is even}\\ & \frac12-\frac1{2n^2}&&\text{ if $n$ is odd}, \end{alignedat} \right. \tag{0} \end{equation*} with equality for some $x,y$ in $[0,1]^n$. The maximum of $L(x,y)$ over all $(x,y)\in[0,1]^n\times[0,1]^n$ is attained. In what follows, let $(x,y)$ be such a maximizer. With $[n]:=\{1,\dots,n\}$, $p$ and $q$ in $\{0,1\}$, and $|K|:=(\text{cardinality of $K$)}$, let \begin{gather*} I_p:=\{i\in[n]\colon x_i=p\},\quad J_q:=\{i\in[n]\colon y_i=q\},\\ I:=\{i\in[n]\colon 0<x_i<1\},\quad J:=\{i\in[n]\colon 0<y_i<1\},\\ s:=\tfrac1n|I\cup J|,\quad s_{pq}:=\tfrac1n|I_p\cup J_q|, \end{gather*} so that $s+s_{00}+s_{01}+s_{10}+s_{11}=1$. If $Ax=0$, then $x=0$ and hence $h=0$ and $L=0$, which makes the inequality in (0) trivial. So, without loss of generality (wlog), $Ax>0$. Similarly, wlog $Ay>0$. So, \begin{equation*} r:=Ay/Ax\in(0,\infty). \tag{1} \end{equation*} Let $\p_u$ denote the partial derivative with respect to a variable $u$. Then \begin{equation*} \p_u H(u,v)=2\Big(\frac v{u+v}\Big)^2 \end{equation*} for $u>0$ and $v>0$. So, for any $i\in I$ \begin{equation*} \frac n2\,\p_{x_i}L =\Big(\frac r{r+1}\Big)^2-\Big(\frac{y_i}{x_i+y_i}\Big)^2=0, \end{equation*} because $(x,y)$ is a maximizer of $L$. So, $y=rx>0$ on $I$. Similarly, $y=rx>0$ on $J$, and hence $y=rx>0$ on $I\cup J$. So, \begin{alignat*}{5} &Ax=&& &&s_{10}&+&s_{11}&&+s a, \\ &Ay=&&s_{01}&& &+&s_{11}&&+s r a, \\ &Ah=&& && &&s_{11}&&+s a \frac{2r}{1+r}, \end{alignat*} where $a:=\frac1s\,\sum_{i\in I\cup J}x_i$ if $s\ne0$ and $a:=1/2$ if $s=0$. So, equality (1) can be rewritten as \begin{equation*} s_{01}+s_{11}=r(s_{10}+s_{11}). \end{equation*} So, if $s_{10}+s_{11}=0$, then $s_{10}+s_{11}=0$ and hence $s_{10}=s_{11}=s_{10}=s_{11}=0$ and $L=0$. So, wlog $s_{10}+s_{11}>0$ and hence $r=\frac{s_{01}+s_{11}}{s_{10}+s_{11}}$. Using this expression for $r$ and the expression $1-s_{10}-s_{11}-s_{10}-s_{11}$ for $s$, we get \begin{equation*} L=M:=\frac{2 s_{01} s_{10} + (s_{01}+ s_{10})s_{11}}{s_{01} + s_{10} + 2 s_{11}}. \end{equation*} Next, \begin{equation*} \p_{s_{11}}M:=\frac{(s_{01}-s_{10})^2}{(s_{01} + s_{10} + 2 s_{11})^2}\ge0. \end{equation*} So, wlog one may replace $s_{11}$ by its largest possible value, $1-s_{01}-s_{10}$: \begin{equation*} L=M\le N:=M|_{s_{11}=1-s_{01}-s_{10}}= \frac{(1-s_{01})s_{01}+(1-s_{10})s_{10}}{2-s_{01}- s_{10}}. \end{equation*} Further, \begin{equation*} (\p_{s_{01}}+\p_{s_{10}})N= \frac{(1-s_{01})(1-s_{10})}{(2-s_{01} s_{10})^2}\ge0. \end{equation*} So, if we increase $s_{01}$ and $s_{10}$ by the same amount, while keeping $s_{01}+s_{10}\le1$, the value of $N$ may only increase. So, \begin{equation*} L\le N|_{s_{10}=1-s_{01}}=2(1-s_{10})s_{10}=H(1-s_{10},s_{10}). \end{equation*} It remains to use the following very simple >**Lemma:** If $k$ and $l$ are nonnegative integers such that $k+l\le n$, then \begin{equation*} H(\tfrac kn,\tfrac ln)\le H(\tfrac mn,\tfrac{n-m}n)=L^*_n, \end{equation*} where \begin{equation*} m:=\lfloor n/2\rfloor. \tag{3} \end{equation*} (This follows because (i) $H(\tfrac kn,\tfrac ln)\le H(\tfrac kn,\tfrac{n-k}n)$ and (ii) $H(s,1-s)$ is decreasing in $|s-1/2|$ for $s\in[0,1]$.) The entire proof is now complete.