The problem comes from the proof of Corollary 5.3.24 in Qing Liu's book Algebraic Geometry and Arithmetic curve.
Let $\DeclareMathOperator{\Spec}{Spec}S=\Spec A$ be the spectrum a discrete valuation ring $A$ with uniformizing parameter $t$ and $f:X\to S$ be a projective morphism. Let $\mathcal{I}$ be a coherent sheaf of ideals of $\mathcal{O}_X$. Do we have that $\mathcal{I}$ is flat over $S$?
My idea: Closed immersion is projective so we can take $X= \Spec \frac{A}{tA}$. Take $\mathcal{I}=\mathcal{O}_X$. Then $\mathcal{I}$ is flat over $S=\Spec A$ iff $A/tA$ is flat over $A$ iff $A/tA$ is a torsion-free $A$-module, which is clearly false.


I think one requires to split the proof of the (the full)result into two cases:-
For (1), since $f$ is projective $f$ is constant precisely when $X$ is a closed point of $S$. Here the result should be true trivially.
For case (2), one could reduce to the case of $S$ being the spectrum of d.v.r(as you've done) and let $x \in S$ be the closed point of $S$. $\mathcal{O}_{S,x}=A$ is a PID. By Cor.4.3.10, we know that $\mathcal{O}_{X,x}$ is flat, hence torsion free, over $A$. Hence $\mathcal{I}_x$ is a torsion free module over $A$. But as explained here, a torsion free module over PID is flat(no hypothesis on finite generation required). This answers the question.