There are some threads, like this and this, about related subjects. The suggested method is to relate $$\min_{w\in \mathbb{C}^n}\|Z-G\,diag(w) G^*\|_2,$$ when you know $Z$ and $G$, to the minimization problem $$\left\{\begin{array}{rrr}
minimize& x\\subject\,to &\|A(w)\|_2\leq x
\end{array}\right.,$$ with $A(w)=Z-G\,diag(w) G^*$, and $x\geq 0$.
Since $\|A(w)\|_2$ is the maximum singular value $\sigma_{max}(A(w))$ of $A(w)$, it follows that $\|A(w)\|_2\leq x$ is equivalent to $$(\sigma_{max}(A(w)) )^2=\lambda_{max}(A(w)^*A(w))\leq x^2,$$ or $$x^2-\lambda_{max}(A(w)^*A(w))=\lambda_{min}(x^2I-A(w)^*A(w))\geq 0.$$ This means that the matrix $$x^2I-A(w)^*A(w)\geq 0, $$ that is, it is a positive semidefinite matrix. This implies that the block matirx $$\left[\begin{array}{rrr}
xI& A(w)\\A(w)^*&xI
\end{array}\right],$$ is positive semidefinite.
It follows that the initial minimizing problem becomes
$$\left\{\begin{array}{rrr}
minimize& x\\\\subject\,to &\left[\begin{array}{rrr}
xI& A(w)\\A(w)^*&xI
\end{array}\right]\geq 0
\end{array}\right.,$$ with $x\geq 0$, $w\in \mathbb{C}^n$, and $A(w)=Z-G\,diag(w) G^*$. The last one leads you to Semidefinite programming, and you can see this closed thread about numerical calculations.