Let $f:X \to Y$ be a surjective, smooth projective morphism of noetherian schemes. Let $\mathcal{L}$ be an inverible sheaf on $X$ satisfying $f\_\*\mathcal{L}$ is locally free and $s \in H^0(\mathcal{L})$ be a global section of $\mathcal{L}$. Is the zero locus of $s$ (in $X$), flat over $Y$?


N.B. If necessary, one can assume the fibers of $f$ are irreducible and $Y$ is affine. Also can assume $\pi\_\*\mathcal{L}$ is free.



Is the zero locus of a global section flat?
You already have trivial counterexamples for your statement, but perhaps you were thinking of a section whose zero locus is irreducible and dominates $Y$. It is false even with that additional assumption:


Let $Y$ be an arbitrary non-singular surface and $Z$ the blow-up up of a (closed) point on $Y$. Then by construction/definition $Z\subseteq X=Y\times \mathbb P^1$. Since $X$ is non-singular, $Z$ is a Cartier divisor and hence there is a line bundle $\mathscr L$ on $X$ such that $Z$ is the zero locus of a global section of $\mathscr L$. Clearly the projection $f:X\to Y$ is flat, so this is a counterexample with the additional property that the zero locus of the section is irreducible and surjects onto $Y$. 


**EDIT:** Oops, I've just realized that there is one more assumption to check, namely that $f\_\*\mathscr L$ is locally free, but it is easy to check that that also holds.


