Let's say we have a random variable $X$ and $Y$, and $Z=X+Y$
Now assume we have a probability density distribution over $Z$: $p(Z)$.
Then the expectation of $Z$ is: $$E(Z)=\int Z p(Z)\,dZ=\int (X+Y)p(Z)\,dZ=(X+Y)\int p(Z)\,dZ = X+Y$$
I obviously understand that we cannot do this, because $X+Y$ are random variables, so we have to do a change of variables instead, and we'll end up with a double integral. We could only do the derivation as I just did if we took the conditional expectation $E(Z\mid ,Y)$ instead. I know that $Z$ "depends on" $X$ and $Y$.
But I am not entirely sure where the technical mistake was. That is, if you would explain to me in the most technically detailed and pedantic way possible what is wrong with this obviously wrong argument, what would you say?