Let $\mathbb{k}$ be an algebraically closed field of characteristic 0. Denote $S=\mathrm{Spec}\:\mathbb{k}[t]$, $U=\mathrm{Spec}\:\mathbb{k}[t, t^{-1}]$, $Z=\mathrm{Spec}\:\mathbb{k}[t]/(t)$.
What is the minimum integer $n$ such that there exist smooth projective morphisms of relative dimension $n$ $X\rightarrow S$, $Y\rightarrow S$ such that there is no $Z$-isomorphism $X_{Z}\rightarrow Y_{Z}$ but there is an $S$-morphism $X\rightarrow Y$ inducing a $U$-isomorphism $X_{U}\rightarrow Y_{U}$?