Is there a nice condition on a closed subscheme $Y$ of $X$ such that for every flat family $Z\to Y$, there is a flat family $W\to X$ whose restriction to $Y$ is $Z$? In particular, I'm interested in the case when the closed subscheme is two lines in $\mathbb{P}^2$, or three planes in $\mathbb{P}^3$, or generally $n$ hyperplanes in $\mathbb{P}^n$.



When can one extend a flat family from a subscheme to the whole scheme?
I'm pretty sure the answer is not in general.
Take a Hilbert scheme which is reducible, for example, that of the Hilbert polynomial $3t + 1$ in $\mathbb{P}^3$. This Hilbert scheme has two irreducible components - the one corresponding to twisted cubics and the one corresponding to degree 3 plane curves union a point. The intersection of the these two components corresponds to degree 3 nodal plane curves with an embedded point "pointing out of the plane". It turns out that both components are rational (actually this is pretty easy to see) and even that the intersection is rational.  

Anyhow, take a line in the twisted cubic component that meets the other component (see III.9.8.4 in Hartshorne's Algebraic Geometry) at a point $[C]$ and a line through $[C]$ contained in the other component. This gives you a flat family over the union of two intersecting lines in $\mathbb{P}^2$, but you will not be able to "fill it in" because the Hilbert scheme in question is not irreducible.


**EDIT**: I realized that, in this example, the family extended to $\mathbb{P}^2$ doesn't have to be as a family of closed subschemes in $\mathbb{P}^3$. Still, it cannot extend to a flat family in this example - just for a different reason. The general fiber of the extension would be a rational curve, but over a line in $\mathbb{P}^2$ you would have a disconnected family. This is impossible.


