As pointed out in the comments, your error here is that your density transformation does not take account of the nonlinearity of the transformation. I will show you a better empirical demonstration of the distributional equivalence, where we don't attempt the transform at all, but simply compare the kernel density of simulated values of the sum with the postulated chi-squared density. I will also show you a simple proof of the distributional equivalence at issue.
Empirical simulation: Rather than attempting the density transformation, let's proceed by simulation, by simulating $N=10^5$ sets of $n=4$ standard normal random variables.
#Generate matrix of simulations
set.seed(1)
N <- 10^5
n <- 4
SIMS <- matrix(rnorm(N*n), nrow = N, ncol = n)
#Compute statistic of interest and its kernel density
STAT <- rep(0, N)
for (i in 1:N) { STAT[i] <- sum(SIMS[i,]^2) }
DENS <- density(STAT)
#Set chi-squared density function
CCC <- function(x) { dchisq(x, df = n) }
#Plot the kernel density against the postulated chi-squared density
plot(DENS, xlim = c(0, 20), lwd = 2, main = 'Simulation of Density')
plot(CCC, xlim = c(0, 20), lwd = 2, lty = 2, col = 'red', add = TRUE)

As you can see from the plot, the simulated values closely follow the postulated chi-squared density. You can easily repeat this simulation analysis for different values of $n$ if you would like to demonstrate the distributional equivalence for other values.
Proving equivalence in distribution: For completeness, I supply you here with a proof of the distributional result you are trying to show by simulation. The simplest way to prove this result is via moment generating functions (or characteristic functions). Let $Z_1, ..., Z_n \sim \text{IID N}(0,1)$ be a set of IID standard normal random variables and let $G = \sum_{i=1}^n Z_i^2$. Using the law of the unconscious statistician and the substitution $y = z \sqrt{1/2-t}$, for all $t < \tfrac{1}{2}$ we have:
$$\begin{align}
\mathbb{E}(\exp(t Z_i^2))
&= \int \limits_{-\infty}^\infty
\exp(t z^2) \cdot \frac{1}{\sqrt{2 \pi}} \exp \bigg( -\frac{1}{2} z^2 \bigg) \ dz \\[6pt]
&= \frac{1}{\sqrt{2 \pi}} \int \limits_{-\infty}^\infty
\exp \bigg( - \Big( \frac{1}{2} - t \Big) z^2 \bigg) \ dz \\[6pt]
&= \frac{1}{\sqrt{(1-2t) \pi}} \int \limits_{-\infty}^\infty
\exp ( -y^2 ) \ dy \\[6pt]
&= \frac{1}{\sqrt{(1-2t)}}, \\[6pt]
\end{align}$$
Thus, for all $t < \tfrac{1}{2}$ the moment generating function for $G$ is:
$$\begin{align}
m_G(t)
&\equiv \mathbb{E}(\exp(tG)) \\[10pt]
&= \prod_{i=1}^n \mathbb{E}(\exp(t Z_i^2)) \\[6pt]
&= \prod_{i=1}^n \frac{1}{\sqrt{(1-2t)}} \\[10pt]
&= (1-2t)^{-n/2}. \\[6pt]
\end{align}$$
This is the moment generating function for the chi-squared distribution, which demonstrates that $G$ is a chi-squared random variable. (See here for proof that the moment generating function determines the distribution.)
DT[, Chi2 := Z_abs* 1/(2*sqrt(X_squared))]
. See this answer for an intuitive explanation $\endgroup$