It would be good to acquire the habit of reserving the word "residuals" for the estimated magnitude of the "error" from, say, a regression.
Now, when in the relation
$$y = m(x) + e$$
we define $m(x)\equiv E(y \mid x)$, then $e$ is the Conditional Expectation Funtion error, which has nothing to do with the usuall "error term" we are talking about in a standard "classical" regression setting. The CEF error is actually and exactly "what is left" after we subtract from $y$ its conditional expectation with respect to $x$.
Then, by construction
$$y = E(y\mid x) + e \implies E(y\mid x) = E[E(y\mid x) \mid x] + E(e\mid x)$$
But by basic properties of the Conditional expectation, $E[E(y\mid x) \mid x] = E(y\mid x)$$ and so we obtain
$$E(y\mid x) = E(y\mid x) + E(e\mid x) \implies E(e\mid x) = 0$$
Always. No matter what functional form does $m(x)$, linear or non-linear.
Reading the OP's comment, what I suspect the authors of the book say "later on" essentially confounds the classical linear regression set up with the Conditional Expectation Function set up, as well as the error term in the classical linear regression model, with the CEF error.