Your current question as stated is a little weaker than the linked original question. So I will answer both negatively by giving an example of $I$ a prime ideal and $J$ is $I$-primary inside a polynomial ring $R$ over the complex number $k$.
The point is the so-called miracle flatness, (in the graded form for this example to ease notations). Let $S=k[l_1,...,l_d]$ where the $l$s form a system of parameters for $R/I$ (and also $R/J$). Then $R/I$ is flat over $S$ iff it is Cohen-Macaulay. So a counter-example exist whenever one can find an example such as $R/I$ is Cohen-Macaulay but $R/J$ is not.
Such examples are easy to find when you simply require $I$ to be the radical of $J$. But if you also want $J$ to be a primary ideal, the most pleasing-looking one is probably:
Let $R=k[a,b,c,x,y,z]$, let $I$ be the $2\times 2$ minors of the matrix $\begin{bmatrix} a & b & c \\ x & y & z\end{bmatrix}$. Let $J=I^2$. Then one can check that $I$ is a prime ideal, $J$ is primary (indeed it agrees with the second symbolic power of $I$), and $R/I$ is Cohen-Macaulay while $R/J$ is not. Note also that $X,Y$, being Spec of polynomial rings $R,S$, are smooth.