$\def\spec{\operatorname{Spec}}$I am trying to understand the proof of Lemma 0474 of the Stacks Project. I'll give some context to its statement before discussing its proof: In commutative algebra, if $k,A$ are rings and $A\to B$ is a surjective ring homomorphism with kernel $I\subset A$, then one has an exact sequence of $B$-modules $$ \label{2nd_fund}\tag{1} I/I^2\to\Omega_{A/k}\otimes_AB\to\Omega_{B/k}\to 0. $$ Moreover, the morphism $I/I^2\to\Omega_{A/k}\otimes_AB$ has a $B$-linear retraction (hence the sequence becomes a splitting s.e.s.) if and only if the $k$-algebra map $A/I^2\to B$ has a section that is a $k$-algebra homomorphism. All of this can be read in Matsumura's Commutative Algebra, Ch. 10, (26.I), Theorem 58 (Matsumura calls \eqref{2nd_fund} the “second fundamental exact sequence”). A sufficient condition for $A/I^2\to B$ to have a section that is a $k$-algebra homomorphism is that $A\to B$ has a section that is a $k$-algebra homomorphism (this is the sufficient condition stated in Lemma 02HP).
If $i:Z\to X$ is now an immersion of schemes (or more generally, of ringed spaces; by definition a topological immersion onto a locally closed subset and such that $f^{-1}\mathcal{O}_Y\to\mathcal{O}_X$ is onto) over $S$, then one has the exact sequence $$ \label{eq}\tag{2} \mathcal{C}_{Z/X}\to i^*\Omega_{X/S}\to\Omega_{Z/S}\to 0. $$ See the Stacks Project, Lemma 01UZ. Here, $\mathcal{C}_{Z/X}$ is the conormal sheaf of $Z$ in $X$.
Now, Lemma 0474 gives a sufficient condition for \eqref{eq} to become a splitting s.e.s., namely, that $i$ has a retraction over $S$. However, I cannot understand the proof, which is “it follows from Algebra, Lemma 02HP.” To prove that \eqref{eq} becomes a splitting s.e.s., I assume that one has to somehow construct an $\mathcal{O}_Z$-linear retraction of $\mathcal{C}_{Z/X}\to i^*\Omega_{X/S}$. But how can this be done? I understand how one can construct a local retraction by means of Algebra, Lemma 02HP. Namely, if we use:
that the sheaf of relative differentials is compatible with restrictions, Lemma 01US,
$\Omega_{\spec A/\spec k}\cong\widetilde{\Omega_{A/k}}$, for any rings $A,k$ (Lemma 01UT), and
Lemma 01I9, point (1),
then in \eqref{eq} we can restrict the schemes $Z,X,S$ to affines and \eqref{eq} becomes \eqref{2nd_fund} tildified over $Z$.
Nevertheless:
I don't know how one can construct a global retraction using solely the algebraic result.