That works. given a real symmetric and positive definite matrix, we can find a real symmetric square root: given $G,$ find orthogonal $P$ such that $P^T G P = D$ is diagonal and positive. So $P D P^T = G.$ Let $\sqrt D$ be the diagonal matrix with entries the (positive) square roots of the relevant entries of $D.$ Then $\left( P \sqrt D P^T \right)^2 = P D P^T =G.$
So we can find symmetric positive definite $H$ with
$$ H^2 = G. $$
Next, find symmetric positive $U$ such that
$$ U^2 = H V H. $$
Let
$$\color{red}{ W = H^{-1} U H^{-1}}. $$
Confirm
$$ W G W = H^{-1} U H^{-1} H^2 H^{-1} U H^{-1} = H^{-1} U U H^{-1} = H^{-1} H V H H^{-1}= V $$
That works. given a real symmetric and positive definite matrix, we can find a real symmetric square root: given $G,$ find orthogonal $P$ such that $P^T G P = D$ is diagonal and positive. So $P D P^T = G.$ Let $\sqrt D$ be the diagonal matrix with entries the (positive) square roots of the relevant entries of $D.$ Then $\left( P \sqrt D P^T \right)^2 = P D P^T =G.$
So we can find symmetric positive definite $H$ with $$ H^2 = G. $$
Next, find symmetric positive $U$ such that $$ U^2 = H V H. $$
Let $$\color{red}{ W = H^{-1} U H^{-1}}. $$
Confirm $$ W G W = H^{-1} U H^{-1} H^2 H^{-1} U H^{-1} = H^{-1} U U H^{-1} = H^{-1} H V H H^{-1}= V $$