Let $X$ be a "nice" scheme and $Z \hookrightarrow X$ closed of codimension $\geq 2$. Let $Y$ over $X \setminus Z$ be a torsor for a finite flat group scheme $G/X$.

Does $Y$ spread out to a $G$-torsor over the whole of $X$?

For $G/X$ finite étale one can use Zariski-Nagata purity to spread $Y$ out to a scheme and then [Szamuely, Galois Groups and Fundamental Groups], p. 171, Lemma 5.3.13 to show that the extension is in fact a $G$-torsor.