# Flatness and intersections of Cohen-Macaulay subvarieties

There's a commutative algebra fact that I would very much like to be true but could, for all I know, be completely false. One version that would be sufficient is:

Say $A$ is a smooth projective variety and $Y$ and $Z$ are closed, irreducible, Cohen-Macaulay subvarieties of $A\times\mathbb{P}^1$ which are flat over $\mathbb{P}^1$. If all the fibers (over $\mathbb{P}^1$) of $Y\cap Z$ have the same dimension as each other, then $Y\cap Z$ is flat over $\mathbb{P}^1$.

If it helps, $A$ is secretly a Grassmannian, $Y$ is the product of $\mathbb{P}^1$ with some subvariety of $A$, all the fibers of $Z$ are isomorphic to each other, and all the fibers of $Y\cap Z$ except the one over $\infty$ are isomorphic to each other. (So I'm assuming the fiber over $\infty$ has the same dimension as the rest, but not that it's isomorphic to the rest.) Crucially, note that I'm NOT assuming that $\mathrm{codim}Y+\mathrm{codim}Z=\mathrm{codim}(Y\cap Z)$.

Does anyone know if this is true, and if so, a simple proof or reference?

No, that is not true. Let $A$ be $\mathbb{P}^3$ with homogeneous coordinates $[X_0,X_1,X_2,X_3]$. Let $[T_0,T_1]$ be homogeneous coordinates on the base $\mathbb{P}^1$. Let $Y$ be the common zero scheme of $X_2^2-X_0X_1$ and $X_3$. Let $Z$ be the common zero scheme of $T_0^2X_3^2-X_0(T_1X_0-T_0X_1)$ and $X_2$. Both of these are irreducible, closed subschemes of $\mathbb{P}^3\times \mathbb{P}^1$ that are flat over $\mathbb{P}^1$. But the intersection is the common zero locus of $X_2$, $X_3$, $X_0X_1$ and $X_0(T_1X_0-T_0X_1)$. This is not flat over $\mathbb{P}^1$.