It suffices to prove that $f$ is universally closed. Let $V \to \mathcal{Y}$ be a smooth morphism where $V$ is an affine scheme. By Properties of Stacks, Lemma \ref{stacks-properties-lemma-points-cartesian} the image $I$ of $|\mathcal{U} \times_\mathcal{Y} V| \to |\mathcal{X} \times_\mathcal{Y} V|$ is the inverse image of the image of $|h|$. Since $|\mathcal{X} \times_\mathcal{Y} V| \to |\mathcal{X}|$ is open (Morphisms of Stacks, Lemma \ref{stacks-morphisms-lemma-fppf-open}) we conclude that $I$ is dense in $|\mathcal{X} \times_\mathcal{Y} V|$. Also since the category of dotted arrows behaves well with respect to base change (Morphisms of Stacks, Lemma \ref{stacks-morphisms-lemma-cat-dotted-arrows-base-change}) the assumption on existence of dotted arrows (after extension) is inherited by the morphisms $\mathcal{U} \times_\mathcal{Y} V \to \mathcal{X} \times_\mathcal{Y} V \to V$. Therefore the assumptions of the lemma are satisfied for the morphisms $\mathcal{U} \times_\mathcal{Y} V \to \mathcal{X} \times_\mathcal{Y} V \to V$. Hence we may assume $\mathcal{Y}$ is an affine scheme. \medskip\noindent Assume $\mathcal{Y} = Y$ is an affine scheme. (From now on we no longer have to worry about the $2$-arrows $\gamma$ and $\gamma'$, see Morphisms of Stacks, Lemma \ref{stacks-morphisms-lemma-cat-dotted-arrows-independent}.) Then $\mathcal{U}$ is quasi-compact. Choose an affine scheme $U$ and a surjective smooth morphism $U \to \mathcal{U}$. Then we may and do replace $\mathcal{U}$ by $U$. Thus we may assume that $\mathcal{U}$ is an affine scheme. \medskip\noindent Assume $\mathcal{Y} = Y$ and $\mathcal{U} = U$ are affine schemes. By Chow's lemma (Theorem \ref{theorem-chow-finite-type}) we can choose a surjective proper morphism $X \to \mathcal{X}$ where $X$ is an algebraic space. We will use below that $X \to Y$ is separated as a composition of separated morphisms. Consider the algebraic space $W = X \times_\mathcal{X} U$. The projection morphism $W \to X$ is of finite type. We may replace $X$ by the scheme theoretic image of $W \to X$ and hence we may assume that the image of $|W|$ in $|X|$ is dense in $|X|$ (here we use that the image of $|h|$ is dense in $|\mathcal{X}|$, so after this replacement, the morphism $X \to \mathcal{X}$ is still surjective). We claim that for every solid commutative diagram $$ \xymatrix{ \Spec(K) \ar[r] \ar[d] & W \ar[r] & X \ar[d] \\ \Spec(A) \ar[rr] \ar@{..>}[rru] & & Y } $$ where $A$ is a discrete valuation ring with field of fractions $K$, there exists a dotted arrow making the diagram commute. First, it is enough to prove there exists a dotted arrow after replacing $K$ by an extension and $A$ by a valuation ring in this extension dominating $A$, see Morphisms of Spaces, Lemma \ref{spaces-morphisms-lemma-push-down-solution}. By the assumption of the lemma we get an extension $K'/K$ and a valuation ring $A' \subset K'$ dominating $A$ and an arrow $\Spec(A') \to \mathcal{X}$ lifting the composition $\Spec(A') \to \Spec(A) \to Y$ and compatible with the composition $\Spec(K') \to \Spec(K) \to W \to X$. Because $X \to \mathcal{X}$ is proper, we can use the valuative criterion of properness (Morphisms of Stacks, Lemma \ref{stacks-morphisms-lemma-criterion-proper}) to find an extension $K''/K'$ and a valuation ring $A'' \subset K''$ dominating $A'$ and a morphism $\Spec(A'') \to X$ lifting the composition $\Spec(A'') \to \Spec(A') \to \mathcal{X}$ and compatible with the composition $\Spec(K'') \to \Spec(K') \to \Spec(K) \to X$. Then $K''/K$ and $A'' \subset K''$ and the morphism $\Spec(A'') \to X$ is a solution to the problem posed above and the claim holds. \medskip\noindent The claim implies the morphism $X \to Y$ is proper by the case of the lemma for algebraic spaces (Limits of Spaces, Lemma \ref{spaces-limits-lemma-refined-valuative-criterion-proper}). By Morphisms of Stacks, Lemma \ref{stacks-morphisms-lemma-image-proper-is-proper} we conclude that $\mathcal{X} \to Y$ is proper as desired.