I believe the answer is no. All of the following will be relative to an algebraically closed field $k$. You may assume $k$ has characteristic $0$, but I think that is unnecessary (use the work of Stefan Schröer).
Let $g',g''>2$ be positive, distinct integers. Let $g$ be $g'+g''$. Let $\overline{M}_g$ denote the Deligne-Mumford moduli stack of stable curves of (arithmetic) genus $g$. Let $\overline{M}_g^o\subset \overline{M}_g$ be the maximal open substack that is a scheme. In particular $\overline{M}_g^o$ intersects the boundary divisor $\Delta_{g',g''}$ since $g'\neq g''$; denote the intersection by $\Delta_{g',g''}^o$. Denote the universal curve over $\overline{M}_g^o$ by $$\pi:\mathcal{C}\to \overline{M}_g^o.$$ Over $\Delta_{g',g''}^o$, the restriction of the universal curve is a union of two proper closed subschemes, $\mathcal{C}'$ and $\mathcal{C}''$, intersecting along divisors, $Z'\subset \mathcal{C}'$, respectively $Z''\subset \mathcal{C}''$, such that $$(\pi':\mathcal{C}'\to \Delta_{g',g''}^o,Z'), \ \text{resp.} \ (\pi'':\mathcal{C}''\to \Delta_{g',g''},Z''),$$ is a family of stable, $1$-pointed curves of (arithmetic) genus $g'$, resp. $g''$.
Let $\delta_{g',g''}$ denote the generic point of $\Delta_{g',g''}^o$, let $R$ be $\mathcal{O}_{\overline{M}_g^o,\delta_{g',g''}}$, the local ring of $\overline{M}_g^o$ at this codimension $1$ point. Of course $R$ is a DVR. Let $S$ be $\text{Spec}(R)$ with its natural morphism to $\overline{M}_g^o$. Denote the closed point of $S$ by $0$, and denote the generic point by $\eta$. Let $$ \pi_S:\mathcal{C}_S\to S $$ be the base change of $\pi$ over $S$. Denote the closed fiber by $C_0$, with its two irreducible components $C'_0$ and $C''_0$ as above. Let $X$ be $\mathcal{C}_S \setminus C''_0$.
By way of contradiction, assume that there exists a Zariski open subset $X'\subset X$ that intersects $C'_0$ and that has a projective compactification $\overline{X}'_S$ over $S$ whose boundary $Y'$ is flat over $S$. In particular, $Y'$ is finite over $S$. Denote by $$u:\widetilde{X}\to \overline{X}'$$ the normalization of $\widetilde{X}$. In particular, the generic fiber $\widetilde{X}_\eta$ is isomorphic to the generic fiber $\widetilde{C}_\eta$, i.e., $\widetilde{X}_\eta \cong \mathcal{C}_\eta$. Moreover, because the closed fiber $\widetilde{X}_0$ is some compactification of an open subset of the genus $g'>0$ curve $C'_0$, in particular $\widetilde{X}_0$ contains no genus $0$ curves. Moreover, $\widetilde{C}_S$ is regular. Thus, by Abhyankar's lemma, etc., the isomorphism of generic fibers extends to an $S$-morphism, $$ v :\mathcal{C}_S \to \widetilde{X}, $$ that is automatically projective. Moreover, this morphism contracts the irreducible component $C''_0$ of the closed fiber of $\mathcal{C}_S$. In particular, for every invertible sheaf $\mathcal{L}$ on $\widetilde{X}$, $v^*\mathcal{L}$ restricts to the trivial invertible sheaf on $C''_0$. In particular, since $\widetilde{X}$ is projective, there exists an invertible sheaf $\mathcal{L}$ that is ample, so that $v^*\mathcal{L}$ is big.
This is impossible. By Franchetta's conjecture / Harer's theorem, the Picard group of $\mathcal{C}_\eta$ is generated by the relative dualizing sheaf, and the Picard group of $\mathcal{C}_S$ is generated by the relative dualizing sheaf together with the invertible sheaf $\mathcal{O}_{\mathcal{C}_S}(\underline{C'}_0)$. The restrictions of these invertible sheaves to $C''_0$ are $\omega_{C''_0}(\underline{Z}'')$ and $\mathcal{O}_{C''_0}(\underline{Z}'')$. But these are linearly independent in $\text{Pic}(C''_0)$, i.e., the universal curve over the generic point of $\Delta_{g',g''}$. Since $v^*\mathcal{L}$ has trivial restriction to $C''_0$, $v^*\mathcal{L}$ is trivial. In particular, the restriction of $v^*\mathcal{L}$ to the generic fiber $\widetilde{C}_\eta$ is trivial. However, by construction, it is also big. This is a contradiction, proving that $\overline{X}'$ does not exist.
Observe the following points. First, $S$ is not Henselian. Second, the residue field of $S$ is not algebraically closed. Third, this argument only works if $\overline{X}'$ is a projective scheme; the argument fails if $\overline{X}'$ is only a proper algebraic space. So, if you really need something like this to hold, there are still directions to explore.