This forces $f \colon X \to \operatorname{Spec} \mathbf Z_p$ to be smooth. In fact, we will only use the criterion for $n = 1$ and $K = \mathbf Q_q(\sqrt{p})$ the ramified extension of ramification index $2$ with residue field $\mathbf F_q$. Note that
$$\mathcal O_K/\mathfrak m_K^2 = \mathcal O_K/(p) \cong \mathbf F_q[\varepsilon]/(\varepsilon^2).$$
We first show that the special fibre $X_0$ is smooth over $\mathbf F_p$. Indeed, if $x \in X_0(\mathbf F_q)$ is an $\mathbf F_q$-point, then the fibre of $X(\mathbf F_q[\varepsilon]/(\varepsilon^2)) \to X(\mathbf F_q)$ above $x$ is $\mathfrak m_x/\mathfrak m_x^2 \otimes_{\kappa(x)} \mathbf F_q$. Since these have the same size for any $q$ and any $x \in X_0(\mathbf F_q)$, we conclude that $\dim_{\kappa(x)} \mathfrak m_x/\mathfrak m_x^2$ is the same for all closed points $x \in X_0$, hence $X_0$ is smooth by Tags 00TR (which also holds over any perfect field by Tag 00TU) and 00NX.
Since $f$ is flat and $f_0 \colon X_0 \to \operatorname{Spec} \mathbf F_p$ is smooth, we conclude that $f$ is smooth, at least if $X$ has no irreducible components lying over the generic point of $\operatorname{Spec} \mathbf Z_p$. (For example, the smooth locus is open and contains the special fibre by Tag 02V4, so it must be everything.)
Remark. The only fact we needed about $\mathbf Z_p$ is that it is a DVR with perfect residue field. We used flatness of $f$, but we don't need to assume a priori that $X_0$ is reduced.
Of course if $X$ has components over $\mathbf Q_p$, we cannot say anything about those as they are not detected by $X(\mathcal O_K/\mathfrak m_K^n)$.