Chi-Square Test vs Distribution confusion Disclaimer: I'm new to stats so please bear with me
Everywhere I look, the Chi-Square Distribution is explained with a (Z-Score)^2 i.e
$$ ((X-\mu )/\sigma )^2 $$ and based on a random variable from a STANDARD NORMAL Distribution in which case it becomes
$$X^2$$
However, the Chi Square Goodness of Fit Test is explained with the following formula:
$$(Oi-Ei)^2/Ei$$
which can be reinterpreted as $$ (X-\mu )^2/\mu $$
What I'm trying to understand is how can the $\chi^2$ Critical Value for a given P-Value that is derived from $$\sum ((Oi-Ei)^2/Ei) $$
be equal to the $\chi^2$ Critical Value that is derived from a $\chi^2$ distribution based on a random variable that follows a Standard Normal Distribution
$$ \sum ((X-\mu )/\sigma )^2 => \sum ((X-0 )/ 1 )^2 => \sum X^2 $$
The reason I'm asking is because I was watching this video https://youtu.be/ZNXso_riZag?t=620 where the guy just plugs in the P-Value and the degrees of freedom without specifying any sort of $\mu$ which leads to me to believe the Critical Value he got was from a $\chi^2$ distribution whose random variable was based on a STANDARD Normal Distribution and yet the actual normal distribution of his problem is different from a Standard Normal Distribution. So shouldn't he be getting a different $\chi^2$ critical value ?
Basically,
$$\sum ((X-\mu )/\sigma )^2 \neq \sum ((Oi-Ei)^2/Ei) $$

It can be shown that $$\chi^2 :=\sum_{j=1}^k\left[\frac{(\text{obs}_j-\text{exp}_j)^2}{\text{exp}_j}\right]\overset{\mathscr L}{\to} \chi^2_{k-1}.\tag 1\label 1$$
That is, the asymptotic distribution of the goodness-of-fit or more formally Pearson $\chi^2$ statistic is chi-square distribution with degrees of freedom equal to the number of cells minus one.
What the video showed is the usage of $\eqref 1$ in the calculation. Implicit is that the total frequency must be reasonably large.
