[guided]We now compute the KKT equations carefully, because the sign and scaling of the multiplier are the whole point of the theorem. The free finite-dimensional variables are $(x_1,\dots,x_N,u_0,\dots,u_{N-1})$; the initial value $x_0=x_0^*$ is fixed data. The defect constraint at index $k$ is the map $G_{k,h}:\mathbb{R}^{nN}\times\mathbb{R}^{mN}\to\mathbb{R}^n$ defined, with $x_0=x_0^*$ held fixed, by
\begin{align*}
G_{k,h}(x_1,\dots,x_N,u_0,\dots,u_{N-1})=\frac{x_{k+1}-x_k}{h_k}-f(x_k,u_k).
\end{align*}
The discrete Lagrangian is the objective plus $\sum_{k=0}^{N-1}\lambda_{k,h}\cdot G_{k,h}$. We use the finite-dimensional equality-constrained KKT necessary condition: for a $C^1$ finite-dimensional equality-constrained problem, LICQ at a local minimizer gives Lagrange multipliers satisfying stationarity, and LICQ also gives uniqueness of the equality multiplier vector. Since LICQ is assumed at the local minimizer for these equality constraints, this result gives a unique defect multiplier vector $\lambda_{k,h}$ and stationarity of $\mathcal{L}_h$ with respect to every free variable.
First vary $u_k$. Only the objective term $h_kL(x_k,u_k)$ and the defect term $\lambda_{k,h}\cdot G_{k,h}$ depend on $u_k$. Differentiating gives
\begin{align*}
0=h_k\nabla_u L(x_{k,h},u_{k,h})-\nabla_u f(x_{k,h},u_{k,h})^\top\lambda_{k,h}.
\end{align*}
The recovered costate is defined by $\mu_{k,h}=-h_k^{-1}\lambda_{k,h}$, so $\lambda_{k,h}=-h_k\mu_{k,h}$. Substitution gives
\begin{align*}
0=h_k\nabla_u L(x_{k,h},u_{k,h})+h_k\nabla_u f(x_{k,h},u_{k,h})^\top\mu_{k,h}.
\end{align*}
Since $h_k>0$, division by $h_k$ gives
\begin{align*}
0=\nabla_u L(x_{k,h},u_{k,h})+\nabla_u f(x_{k,h},u_{k,h})^\top\mu_{k,h}.
\end{align*}
This is exactly $0=\nabla_u H(x_{k,h},\mu_{k,h},u_{k,h})$, because $H(x,p,u)=L(x,u)+p\cdot f(x,u)$.
Next vary the terminal variable $x_N$. The variable $x_N$ appears in $\Phi(x_N)$ and in the last defect $G_{N-1,h}$ through the term $x_N/h_{N-1}$. Therefore stationarity gives
\begin{align*}
0=\nabla\Phi(x_{N,h})+\frac{\lambda_{N-1,h}}{h_{N-1}}.
\end{align*}
Using $\mu_{N-1,h}=-h_{N-1}^{-1}\lambda_{N-1,h}$, this becomes
\begin{align*}
\mu_{N-1,h}=\nabla\Phi(x_{N,h}).
\end{align*}
This is the discrete transversality condition.
Finally fix $1\le k\le N-1$ and vary the interior state $x_k$. This variable appears in three places: in the running cost $h_kL(x_k,u_k)$, in the previous defect $G_{k-1,h}$ through $x_k/h_{k-1}$, and in the current defect $G_{k,h}$ through $-x_k/h_k-f(x_k,u_k)$. Differentiating those three contributions gives
\begin{align*}
0=h_k\nabla_x L(x_{k,h},u_{k,h})+\frac{\lambda_{k-1,h}}{h_{k-1}}-\frac{\lambda_{k,h}}{h_k}-\nabla_x f(x_{k,h},u_{k,h})^\top\lambda_{k,h}.
\end{align*}
Substituting $\lambda_{k-1,h}=-h_{k-1}\mu_{k-1,h}$ and $\lambda_{k,h}=-h_k\mu_{k,h}$ gives
\begin{align*}
0=h_k\nabla_x L(x_{k,h},u_{k,h})-\mu_{k-1,h}+\mu_{k,h}+h_k\nabla_x f(x_{k,h},u_{k,h})^\top\mu_{k,h}.
\end{align*}
Rearranging yields the backward discrete adjoint equation
\begin{align*}
\mu_{k-1,h}-\mu_{k,h}-h_k\nabla_x f(x_{k,h},u_{k,h})^\top\mu_{k,h}=h_k\nabla_x L(x_{k,h},u_{k,h}).
\end{align*}
The appearance of $h_k$ in this recursion is a direct consequence of differentiating the cost and defect at node $k$; no reindexing is being hidden.[/guided]