We already know that $M$ is a uniform categorical moduli space in the category of affine schemes. By Lemma \ref{lemma-check-uniform-categorical-quotient-on-affines} it suffices to show that the base change $f' : M' \times_M \mathcal{X} \to M'$ is a categorical moduli space for any flat morphism $M' \to M$ of affine schemes. Observe that $\mathcal{X}' = M' \times_M \mathcal{X}$ is well-nigh affine by Lemma \ref{lemma-affine-over-well-nigh-affine}. This after replacing $\mathcal{X}$ by $\mathcal{X}'$ and $M$ by $M'$, we reduce to proving $f$ is a categorical moduli space. \medskip\noindent Let $g : \mathcal{X} \to Y$ be a morphism where $Y$ is an algebraic space. We have to show that $g = h \circ f$ for a unique morphism $h : M \to Y$. \medskip\noindent Uniqueness. Suppose we have two morphisms $h_i : M \to Y$ with $g = h_1 \circ f = h_2 \circ f$. Let $M' \subset M$ be the equalizer of $h_1$ and $h_2$. Then $M' \to M$ is a monomorphism and $f : \mathcal{X} \to M$ factors through $M'$. Thus $M' \to M$ is a universal homeomorphism. We conclude $M'$ is affine (Morphisms, Lemma \ref{morphisms-lemma-universal-homeomorphism}). But then since $f : \mathcal{X} \to M$ is a categorical moduli space in the category of affine schemes, we see $M' = M$. \medskip\noindent Existence. Below we will show that for every $p \in M$ there exists a cartesian square $$ \xymatrix{ \mathcal{X}' \ar[r] \ar[d] & \mathcal{X} \ar[d] \\ M' \ar[r] & M } $$ with $M' \to M$ an \'etale morphism of affines and $p$ in the image such that the composition $\mathcal{X}' \to \mathcal{X} \to Y$ factors through $M'$. This means we can construct the map $h : M \to Y$ \'etale locally on $M$. Since $Y$ is a sheaf for the \'etale topology and by the uniqueness shown above, this is enough (small detail omitted). \medskip\noindent Let $y \in |Y|$ be the image of $p$. Let $(V, v) \to (Y, y)$ be an \'etale morphism with $V$ affine. Consider $\mathcal{X}' = V \times_Y \mathcal{X}$. Observe that $\mathcal{X}' \to \mathcal{X}$ is separated and \'etale as the base change of $V \to Y$. Moreover, $\mathcal{X}' \to \mathcal{X}$ induces isomorphisms on automorphism groups (Morphisms of Stacks, Remark \ref{stacks-morphisms-remark-identify-automorphism-groups}) as this is true for $V \to Y$, see Morphisms of Stacks, Lemma \ref{stacks-morphisms-lemma-base-change-stabilizer-preserving}. Choose a presentation $\mathcal{X} = [U/R]$ as in Lemma \ref{lemma-well-nigh-affine}. Set $U' = \mathcal{X}' \times_\mathcal{X} U = V \times_Y U$ and choose $u' \in U'$ mapping to $p$ and $v$ (possible by Properties of Spaces, Lemma \ref{spaces-properties-lemma-points-cartesian}). Since $U' \to U$ is separated and \'etale we see that every finite set of points of $U'$ is contained in an affine open, see More on Morphisms, Lemma \ref{more-morphisms-lemma-separated-locally-quasi-finite-over-affine}. On the other hand, the morphism $U' \to \mathcal{X}'$ is surjective, finite, flat, and locally of finite presentation. Setting $R' = U' \times_{\mathcal{X}'} U'$ we see that $s', t' : R' \to U'$ are finite locally free. By Groupoids, Lemma \ref{groupoids-lemma-find-invariant-affine} there exists an $R'$-invariant affine open subscheme $U'' \subset U'$ containing $u'$. Let $\mathcal{X}'' \subset \mathcal{X}'$ be the corresponding open substack. Then $\mathcal{X}''$ is well-nigh affine. By Lemma \ref{lemma-well-nigh-affine-moduli-space-etale} we obtain a cartesian square $$ \xymatrix{ \mathcal{X}'' \ar[r] \ar[d] & \mathcal{X} \ar[d] \\ M'' \ar[r] & M } $$ with $M'' \to M$ \'etale. Since $\mathcal{X}'' \to M''$ is a categorical moduli space in the category of affine schemes we obtain a morphism $M'' \to V$ such that the composition $\mathcal{X}'' \to \mathcal{X}' \to V$ is equal to the composition $\mathcal{X}'' \to M'' \to V$. This proves our claim and finishes the proof.