We first do some reductions; we urge the reader to skip ahead. The question is local on $S$, hence we may assume $S$ is affine. Write $S = \lim S_i$ as a cofiltered limit of affine schemes $S_i$ of finite type over $\mathbf{Z}$. For some $i$ we can find a family of curves $X_i \to S_i$ whose base change is $X \to S$. This follows from Lemma \ref{lemma-curves-qs-lfp} and Limits of Stacks, Lemma \ref{stacks-limits-lemma-representable-by-spaces-limit-preserving}. Let $s_i \in S_i$ be the image of $s$. Observe that $\kappa(s) = \colim \kappa(s_i)$ and that $X_s$ is a scheme (Spaces over Fields, Lemma \ref{spaces-over-fields-lemma-codim-1-point-in-schematic-locus}). After increasing $i$ we may assume there exists a morphism $h_{i, 0} : X_{i, s_i} \to Y_i$ of finite type schemes over $\kappa(s_i)$ whose base change to $\kappa(s)$ is $h_0$, see Limits, Lemma \ref{limits-lemma-descend-finite-presentation}. After increasing $i$ we may assume $Y_i$ is proper over $\kappa(s_i)$, see Limits, Lemma \ref{limits-lemma-eventually-proper}. Let $g_{i, 0} : Y_0 \to Y_{i, 0}$ be the projection. Observe that this is a faithfully flat morphism as the base change of $\Spec(\kappa(s)) \to \Spec(\kappa(s_i))$. By flat base change we have $$ h_{0, *}\mathcal{O}_{X_s} = g_{i, 0}^*h_{i, 0, *}\mathcal{O}_{X_{i, s_i}} \quad\text{and}\quad R^1h_{0, *}\mathcal{O}_{X_s} = g_{i, 0}^*Rh_{i, 0, *}\mathcal{O}_{X_{i, s_i}} $$ see Cohomology of Schemes, Lemma \ref{coherent-lemma-flat-base-change-cohomology}. By faithful flatness we see that $X_i \to S_i$, $s_i \in S_i$, and $X_{i, s_i} \to Y_i$ satisfies all the assumptions of the lemma. This reduces us to the case discussed in the next paragraph. \medskip\noindent Assume $S$ is affine of finite type over $\mathbf{Z}$. Let $\mathcal{O}_{S, s}^h$ be the henselization of the local ring of $S$ at $s$. Observe that $\mathcal{O}_{S, s}^h$ is a G-ring by More on Algebra, Lemma \ref{more-algebra-lemma-henselization-G-ring} and Proposition \ref{more-algebra-proposition-ubiquity-G-ring}. Suppose we can construct a family of curves $Y' \to \Spec(\mathcal{O}_{S, s}^h)$ and a morphism $$ h' : X \times_S \Spec(\mathcal{O}_{S, s}^h) \longrightarrow Y' $$ over $\Spec(\mathcal{O}_{S, s}^h)$ whose base change to the closed point is $h_0$. This will be enough. Namely, first we use that $$ \mathcal{O}_{S, s}^h = \colim_{(U, u)} \mathcal{O}_U(U) $$ where the colimit is over the filtered category of  elementary \'etale neighbourhoods (More on Morphisms, Lemma \ref{more-morphisms-lemma-describe-henselization}). Next, we use again that given $Y'$ we can descend it to $Y \to U$ for some $U$ (see references given above). Then we use Limits, Lemma \ref{limits-lemma-descend-finite-presentation} to descend $h'$ to some $h$. This reduces us to the case discussed in the next paragraph. \medskip\noindent Assume $S = \Spec(\Lambda)$ where $(\Lambda, \mathfrak m, \kappa)$ is a henselian Noetherian local G-ring and $s$ is the closed point of $S$. Recall that the map $$ \Deformationcategory_{X_s \to Y_0} \to \Deformationcategory_{X_s} $$ is an equivalence, see Deformation Problems, Lemma \ref{examples-defos-lemma-schemes-morphisms-smooth-to-base}. (This is the only important step in the proof; everything else is technique.) Denote $\Lambda^\wedge$ the $\mathfrak m$-adic completion. The pullbacks $X_n$ of $X$ to $\Lambda/\mathfrak m^{n + 1}$ define a formal object $\xi$ of $\Deformationcategory_{X_s}$ over $\Lambda^\wedge$. From the equivalence we obtain a formal object $\xi'$ of $\Deformationcategory_{X_s \to Y_0}$ over $\Lambda^\wedge$. Thus we obtain a huge commutative diagram $$ \xymatrix{ \ldots \ar[r] & X_n \ar[r] \ar[d] & X_{n - 1} \ar[r] \ar[d] & \ldots \ar[r] & X_s \ar[d] \\ \ldots \ar[r] & Y_n \ar[r] \ar[d] & Y_{n - 1} \ar[r] \ar[d] & \ldots \ar[r] & Y_0 \ar[d] \\ \ldots \ar[r] & \Spec(\Lambda/\mathfrak m^{n + 1}) \ar[r] & \Spec(\Lambda/\mathfrak m^n) \ar[r] & \ldots \ar[r] & \Spec(\kappa) } $$ The formal object $(Y_n)$ comes from a family of curves $Y' \to \Spec(\Lambda^\wedge)$ by Quot, Lemma \ref{quot-lemma-curves-existence}. By More on Morphisms of Spaces, Lemma \ref{spaces-more-morphisms-lemma-algebraize-morphism} we get a morphism $h' : X_{\Lambda^\wedge} \to Y'$ inducing the given morphisms $X_n \to Y_n$ for all $n$ and in particular the given morphism $X_s \to Y_0$. \medskip\noindent To finish we do a standard algebraization/approximation argument. First, we observe that we can find a finitely generated $\Lambda$-subalgebra $\Lambda \subset A \subset \Lambda^\wedge$, a family of curves $Y'' \to \Spec(A)$ and a morphism $h'' : X_A \to Y''$ over $A$ whose base change to $\Lambda^\wedge$ is $h'$. This is true because $\Lambda^\wedge$ is the filtered colimit of these rings $A$ and we can argue as before using that $\Curvesstack$ is locally of finite presentation (which gives us $Y''$ over $A$ by Limits of Stacks, Lemma \ref{stacks-limits-lemma-representable-by-spaces-limit-preserving}) and using  Limits of Spaces, Lemma \ref{spaces-limits-lemma-descend-finite-presentation} to descend $h'$ to some $h''$. Then we can apply the approximation property for G-rings (in the form of Smoothing Ring Maps, Theorem \ref{smoothing-theorem-approximation-property}) to find a map $A \to \Lambda$ which induces the same map $A \to \kappa$ as we obtain from $A \to \Lambda^\wedge$. Base changing $h''$ to $\Lambda$ the proof is complete.