TITLE: curve over higher dimensional basis with 0-dimensional locus of bad reduction
QUESTION [5 upvotes]: Is there an example of a flat proper relative curve $X/S$ with geometrically connected fibres and with $\mathrm{dim} S > 1$ and $S$ regular and connected with $0$-dimensional locus of bad reduction $S_{\mathrm{bad}} = \{s \in S: X_s/s \text{ not smooth}\}$?

REPLY [8 votes]: The answer is no if $f:X\to S$ is locally projective and the genus $g$ of the general fiber is $\geq1$. (About these restrictions, see remarks at the end). 
Assuming this, put $U:=S\smallsetminus S_\mathrm{bad}$. By assumption, $S$ is regular and $U$ contains all points of codimension $\leq1$ of $S$. I do not assume $\dim S_\mathrm{bad}=0$, but of course we may reduce to this case if we prefer.
The main point is:

$X_U$ extends uniquely to a proper and smooth $f':X'\to S$. 

This follows from my paper:  Un théorème de pureté pour les familles de courbes lisses, CRAS Paris vol 300 issue 14 (1985), 489-492.
Now let us prove that the identification $X_U\cong X'_U$ extends to an isomorphism $X\cong X'$. Fix an invertible sheaf $L$ on $X$, very ample relative to $S$ and such that $\mathscr{E}:=f_*L$ is locally free on $S$, and commutes with base change in the usual sense. Moreover, assume that the degree of $L$ in the fibers is large enough ($\geq2g+2$ ?) to automatically ensure these properties on all smooth curves of genus $g$. So, we have a closed immersion $i:X\hookrightarrow \mathbb{P}(\mathscr{E})$.

Claim: The pair $(X,L)$ (subject to the conditions of flatness, smoothness over $U$, and strong ampleness) is determined up to unique isomorphism by $(X_U,L_U)$.

Indeed, $(X_U,L_U)$ determines  $\mathscr{E}_U$ and $i_U:X_U\hookrightarrow \mathbb{P}(\mathscr{E}_U)$. Then we recover $\mathscr{E}$ as $j_*\mathscr{E}_U$ (by the codimension assumption, $j$ being the inclusion of $U$), and then $X$ must be isomorphic to the schematic closure of $i_U(X_U)$ in $\mathbb{P}(\mathscr{E})$. Of course, $L$ is then the restriction of $\mathscr{O}_{\mathbb{P}(\mathscr{E})}(1)$ to $X$.
Now we can "do the same" with $X'$. More precisely, over $X'_U=X_U$ we have the sheaf $L_U$, and since $X'$ is a regular scheme this extends to an invertible sheaf $L'$ on $X'$. Since the degree in the fibers is locally constant, this $L'$ satisfies all our ampleness requirements. So we get a pair $(X',L')$ whose restriction to $U$ is isomorphic to $(X_U,L_U)$, and we conclude by the above claim.
Remark 1. One can probably get rid of the projective assumption: we may assume $S$ local henselian, in which case projectivity should be automatic.
Remark 2. My purity result might be true in genus $0$, but I never worked this out.