The OP is correct that you just cannot "add" convergence in distribution, for this you have to be aware of the covariance structure, which is fortunately enough trivial in this case.
update: Thanks for pointing out the earlier, crucial (and pretty bad) mistake. Hopefully the following answer is more or less correct...
Suppose, for the moment, that $n_Y = \lceil c n_X \rceil$, for some $c > 0$.
Define
$$ \theta_X = \frac {\hat p_X - p} { \sqrt{ \left(\frac 1 {n_X} + \frac 1 {n_Y}\right) p(1-p)}} \quad \mbox{and} \quad \theta_Y = \frac {\hat p_Y - p} { \sqrt{ \left(\frac 1 {n_X} + \frac 1 {n_Y}\right) p(1-p)}},$$
so that $$T = \sqrt{\frac{p(1-p)}{\hat p(1 - \hat p)}} (\theta_X - \theta_Y).$$
Now $\theta_X$ converges in distribution to $N\left(0,\frac c {1+c} \right)$, whereas $\theta_Y$ converges in distribution to $N\left(0, \frac 1 {1 + c} \right)$, and jointly they converge to the independent product of these two distributions.
It follows that $\theta_X - \theta_Y$ converges (using the continuous mapping theorem, hopefully correctly this time) to a $N(0,1)$ distribution. Since $\hat p(1-\hat p) \rightarrow p(1-p)$ almost surely, it follows that $T \stackrel{d}{\rightarrow} N(0,1)$.
In a similar way, when e.g. $n_Y = n_X^2$ you can find that $\theta_X \stackrel{d}{\rightarrow} N(0,1)$ and $\theta_Y \stackrel{a.s.}{\rightarrow} 0$, so that again $T \stackrel{d}{\rightarrow} N(0,1)$.
Unfortunately I don't see how to avoid making some assumption on the relative growth of $n_X$ and $n_Y$, but perhaps a more general argument is possible.
Best Answer
In linear regression the assumption is that $X$ and $Y$ are not random variables. Therefore, the model
$$Z = a X + b Y + \epsilon$$
is algebraically the same as
$$Z - \frac{1}{2} X - \frac{1}{2} Y = (a - \frac{1}{2})X + (b - \frac{1}{2})Y + \epsilon = \alpha X + \beta Y + \epsilon.$$
Here, $\alpha = a - \frac{1}{2}$ and $\beta =b - \frac{1}{2}$. The error term $\epsilon$ is unaffected. Fit this model, estimating the coefficients as $\hat{\alpha}$ and $\hat{\beta}$, respectively, and test the hypothesis $\alpha = \beta = 0$ in the usual way.
The statistic written at the end of the question is not a chi-squared statistic, despite its formal similarity to one. A chi-squared statistic involves counts, not data values, and must have expected values in its denominator, not covariates. It's possible for one or more of the denominators $\frac{x_i+y_i}{2}$ to be zero (or close to it), showing that something is seriously wrong with this formulation. If even that isn't convincing, consider that the units of measurement of $Z$, $X$, and $Y$ could be anything (such as drams, parsecs, and pecks), so that a linear combination like $z_i - (x_i+y_i)/2$ is (in general) meaningless. It doesn't test anything.