TITLE: Group scheme counterexample
QUESTION [6 upvotes]: Could someone give me an example of a finite group scheme $G$ (over some base $S$) so that $G$ minus a point is still a group scheme over $S$, but not affine over $S$?
Oort mentions that there are examples of this kind in his book "Commutative Group Schemes", but doesn't give an example.

REPLY [2 votes]: Here's a minor variant on Margaux's comment from a year ago.  Let $S = \mathbb{A}^2$ (say, over your favorite field), and let $\pi: G \to S$ be the constant $S$-group scheme $(\mathbb{Z}/2\mathbb{Z})_S$.  As a scheme, it is a disjoint union of two copies of $S$.
If we remove a point $g$ from the non-identity section, we get an $S$-group scheme $G - g$, whose underlying scheme is a disjoint union of $S$ and $S - \pi(g)$ (note that $(G-g) \times_S (G-g)$ is a disjoint union of an identity section $S$ and 3 copies of $S - \pi(g)$).  This is not affine over $S$, since $S$ is affine and $G - g$ is not.