Question about violating the zero conditional mean assumption Question for y'all with a background in econometrics.

Does the zero conditional mean assumption rely on complete randomness in a trial when doing regression analysis?

For example, if I was testing the effect of a free training program on wage, and the men in the trial were randomly given x amount of months of training, but the women were not assigned randomly, would that be a violation of a ZCM? I am struggling to make the connection between randomness and ZCM at all, but it was pointed out to me by someone that it is in fact influential.
If you introduce any sort of correlation between the explanatory variables $X$ and the error $\epsilon$ then the zero conditional mean may be violated. In your example, if you were to assign women their training time according to their age, then the exogeneity assumption breaks.

More formally, this last condition means

$$
\mathbb{E}[\epsilon|X] = 0
$$

If, wlog we assume $\mathbb{E}[\epsilon] = 0$, and there's a non-vanishing correlation between $X$ and $\epsilon$ then

$$
 0\not= \mathbb{C}{\rm ov}[X,\epsilon] = \mathbb{E}[X^t\epsilon] + \mathbb{E}[X] \mathbb{E}[\epsilon] = \mathbb{E}[X^t\epsilon]
$$

therefore $\mathbb{E}[\epsilon|X]\not = 0$