It suffices to prove that $d (y - x)$ is a square, because
$$\tag{id}(y - x) z = x y,$$
and thus
$$
d (y - x) z^{2} = d x y z.
$$
Let $p$ be a prime, and let $p^{a}, p^{b}, p^{c}$ be the highest powers of $p$ that divide respectively $x, y, z$.
Let us look at (the exponent of) the highest powers of $p$ that divides $y - x$.
If $a \ne b$, the highest power of $p$ that divides $y - x$ is $\min(a, b)$. Comparing the powers of $p$ in (id) we get thus
$$
\min(b, a) + c = a + b,
$$
so that $c = \max(a, b)$.
This implies that the highest power of $p$ that divides $d (y - x)$ is
$$
\min(a, b, c) + \min(b, a) = 2 \min(b, a).
$$
So let us consider the case $a = b$. Writing $x = p^{a} x'$, $y = p^{a} y'$, we obtain
$$
p^{a} (y' - x') z = x' y' p^{2 a}.
$$
Therefore, if $e$ is the highest power of $p$ that divides $y' - x'$, we have $e + c = a$, so that $c \le a$. Thus in this case the highest power of $p$ that divides $d (y - x)$ is $c + a + e = 2 a$.
We have proved that the highest power of every prime that divides $d (y - x)$ has an even exponent. Thus $d (y - x)$ is a square.