Let $E$ be a complex Hilbert space
Let $A,B\in \mathcal{L}(E)^+$. Assume that there exists $z\in \mathbb{C}^*$ such that $AB=zBA$. Why $$AB=BA\;?$$
Let $E$ be a complex Hilbert space
Let $A,B\in \mathcal{L}(E)^+$. Assume that there exists $z\in \mathbb{C}^*$ such that $AB=zBA$. Why $$AB=BA\;?$$
If $AB=0$ or $BA=0$, you are done. Otherwise, from $BA=|z|^2BA$, you obtain that $|z|=1$.
We have $$\{0\}\cup\sigma(BA)=\{0\}\cup\sigma(AB)=\{0\}\cup\sigma(zBA)
=\{0\}\cup z\,\sigma(BA).
$$
So $$\tag1\lambda\in\sigma(BA)\iff z\lambda\in\sigma(BA).$$
We also have, using that $\{0\}\cup\sigma(TS)=\{0\}\cup\sigma(ST)$,
$$\tag2
\{0\}\cup\sigma(BA)=\{0\}\cup\sigma(B^{1/2}(B^{1/2}A))=\{0\}\cup\sigma(B^{1/2}AB^{1/2})\subset[0,\infty).
$$
Note that $\sigma(BA)\ne\{0\}$. Because if $\sigma(BA)=\{0\}$, then (2) gives $\sigma(B^{1/2}AB^{1/2})=\{0\}$; but this is a positive operator, so we would get $B^{1/2}AB^{1/2}=0$, which is the same as $(A^{1/2}B^{1/2})^*A^{1/2}B^{1/2}=0$, so $A^{1/2}B^{1/2}=0$ which in turn gives $AB=0$, and then $BA=0$.
Now, using $(2)$, take $\lambda>0$ with $\lambda\in \sigma(BA)$. Then, from $(1)$, $z\lambda\in(0,\infty)$, which implies $z\in (0,\infty)$. So $z$ is a positive real number with $|z|=1$, i.e. $z=1$.