The question asks what is the wrong reasoning in this statement. If we have $w = f(x,y,z)$ and $z = g(x,y)$ then:
$\frac{\partial w}{\partial x} = \frac{\partial w}{\partial x}\frac{\partial x}{\partial x} + \frac{\partial w}{\partial y}\frac{\partial y}{\partial x} + \frac{\partial w}{\partial z}\frac{\partial z}{\partial x} = \frac{\partial w}{\partial x} + \frac{\partial w}{\partial z}\frac{\partial z}{\partial x}$
That implies $\frac{\partial w}{\partial z}\frac{\partial z}{\partial x} = 0$ that is in general not true. My first insight was the actually you need to replace $\frac{\partial w}{\partial x}$ with $\frac{\partial f}{\partial x}$ so you can't just cancel them out, but trying a few examples I got the same expression for both of them. I don't know if that was true just for my examples or if I'm missing something about some hypothesis of the chain rule. Thanks in advance
This is because the notation being used is awfully ambiguous, as often happens with these multivariable chain rule problems if whoever is writing about it isn't careful. The two instances of '$\frac{\partial w}{\partial x}$' refer to different things, so are not necessarily equal.
Here's an approach you may find more precise and unambiguous. Note that the final function you are considering $w(x,y)$ is given as a composite $\mathbb{R}^2 \rightarrow \mathbb{R}^3 \rightarrow \mathbb{R}$. I'll use $(x_1,x_2)$ for the coordinates in $\mathbb{R}^2$ and $(y_1, y_2, y_3)$ for the coordinates in $\mathbb{R}^3$. Note that with:
we get that $w(x_1,x_2)=f(y_1,y_2,y_3)$.
We can then apply the chain rule as $\frac{\partial w}{\partial x_1} = \frac{\partial f}{\partial y_1}\frac{\partial y_1}{\partial x_1} + \frac{\partial f}{\partial y_2}\frac{\partial y_2}{\partial x_1} + \frac{\partial f}{\partial y_3}\frac{\partial y_3}{\partial x_1}$. This should be much clearer for you to work with.