In [1], Huybrechts and Mauri argue that a holomorphic Lagrangian fibration $f: X \to B$ with smooth base $B$ is flat. This is an application of so called miracle flatness [2, Thm 23.1], because Lagrangian fibrations have equidimensional fibers. Then they write
Remark 1.18. Note that the conclusion that $f$ is flat really needs the base to be smooth. In fact, by miracle flatness, $f$ is flat if and only if $B$ is smooth.
I see that smoothness of $B$ is needed to apply miracle flatness, but I don't see the converse. Why does flatness necessarily fail if $B$ is not smooth?
[1] Huybrechts, Mauri, Lagrangian fibrations, arXiv, 2022
[2] Matsumura, Commutative Ring Theory, 1986