This is something of a follow-up question to this one; I hope people won't think this is a duplicate. At least in my head, it seems like a distinct enough question to merit a fresh start.

All my schemes will be finite type over an algebraically closed field $k$. Let $X\to S$ be a flat family of affine schemes over smooth affine base. Let's say for now that each fiber and the whole family have rational singularities, and thus are Cohen-Macaulay. Assume, furthermore, that $X$ has an action of the group scheme $T=(\mathbb{G}_m)_S$; this is the same data as a grading on $k[X]$ such that $k[S]$ has degree 0.

Now, we can take the schematic fixed points $X^T$ of this family, which is a subscheme of $X$ whose points over any ring are invariant points of $X$. Concretely, this is the vanishing set of the ideal generated by all functions of non-zero degree.

Must the morphism $X^T\to S$ be flat? If not, are there stricter hypotheses than I gave above which would assure it is?

For example, consider the family $$X=\mathrm{Spec}[x,y,z,a_0,\dots, a_{n-1}]/(xy=z^n+a_{n-1}z^{n-1}+\cdots + a_0)$$ where $S=\mathrm{Spec}[a_0,\dots, a_{n-1}]$ with $x$ having degree 1, $y$ degree $-1$ and $z,a_i$ having degree 0. In this case $$X^T=\mathrm{Spec}[z,a_0,\dots, a_{n-1}]/(z^n+a_{n-1}z^{n-1}+\cdots + a_0=0),$$ which is, of course, flat over $S$, even though the number of closed points in a fiber (the number of roots of $z^n+a_{n-1}z^{n-1}+\cdots + a_0$) varies from $n$ to $1$.

3more comments