My question is related to the answer for the question here What are the degrees of freedom of a distribution?, which implicates that whether some tests $(\chi^2, F)$ use degrees of freedom and some others don't $(Z)$ is determined by if the test statistic depends on the sample size, the number of groups, or both.
However, there are examples of $Z$ statistics that use the sample size in estimation but still follow, say, $Z$ distribution and thus don't involve the degrees of freedom. One case is the testing of independent population means with known population variances. The test statistic is given by:
$Z=\frac{(\bar{X_1}-\bar{X_2})-(\mu_{D,0})}{\sigma_{(\bar{X_1}-\bar{X_2})}}\sim N(0,1)$
in which:
$\sigma_{(\bar{X_1}-\bar{X_2})}=\sqrt{\frac{\sigma^2_1}{n_1}+\frac{\sigma^2_2}{n_2}}$
$\mu_{D,0}$ is the difference of hypothesized population means.
How should I differentiate these circumstances?