# Does pullback by diagonal map preserve flatness?

Let $X \to S$ be a smooth variety over a smooth affine variety $S$. The structure map is flat, smooth, surjective and projective. In fact, special case $S=\mathbb{A}_k^1$ and $X=\tilde{X} \times \mathbb{A}^1_k$ for some smooth projective variety $\tilde{X}$ over field $k$ is the most interesting to me.

The diagonal map $\Delta:X \to X \times_S X$ is a map over $S.$ Let $\mathcal{F}$ be a coherent sheaf on $X \times_S X$ flat over $S$. Is it true that pullback by the diagonal map $\Delta^*(\mathcal{F})$ is flat over $S$? Is it true under some special conditions?

No, that is not true in general. For example, let $\tilde{X} = \mathbb{A}^1_k$. Let $$i:S \to \tilde{X} \times_k \tilde{X} \times_k S = X \times_S X, \quad t \mapsto (x_0,t,t),$$ for some point $x_0 \in \tilde{X}$. The composition of $i$ with the projection $X \times_S X \to S$ is the identity map, hence the sheaf $F = i_*\mathcal{O}_S$ on $X \times_S X$ is flat over $S$. On the other hand, its pullback to the diagonal is just the structure sheaf of the point $(x_0,x_0) \in \tilde{X} \times_k S = X$, and it is not flat over $S$.