As defined in the textbook, it takes the branch cut along positive real axis. So the argument angle is $[0,2\pi)$. This is no problem. But in the example, it sets $f(z)=\frac1{\sqrt{2-z}}$ and claims
$$\frac1{\sqrt{2-z}}=\frac i{\sqrt{z-2}}$$
and the phase factor of $f(z)$ is also $-1$.
If use the branch cut from $2$ to infinity, then $2-z=(z-2)e^{i\pi}$, so
$$f(z)=\frac1{\sqrt{2-z}}=\frac1{\sqrt{(z-2)e^{i\pi}}}=\frac{-i}{\sqrt{z-2}}$$
Is the textbook wrong?



You're both wrong because you're ignoring subtleties. It's equivalent to think about the simpler question:
Notice that this is equivalent to $\sqrt{-z}=i\sqrt{z}$. $-z$ and $z$ have the same modulus, so that doesn't need to be worried about. We would require $\exp i\frac{\arg(-z)}{2}=\exp i\frac{\pi+\arg(z)}{2}$ which happens when and only when $\arg(-z)$ and $\pi+\arg(z)$ differ by an even multiple of $2\pi$. The former is in range $(-\pi,\pi]$, the latter in range $(0,2\pi]$ so this could only happen if they were literally equal.
For this principal argument, we can check case by case that: $$\Im z>0\implies\arg(-z)=\arg(z)-\pi,\Im z<0\implies\arg(-z)=\arg(z)+\pi>0$$It follows that the stated equation holds for all $z$ with $\Im z<0$ and for $z\in(0,\infty)$.
For $z\in(-\infty,0)$ and for $\Im z>0$, it is instead true that $\frac{1}{\sqrt{z}}=\frac{-i}{\sqrt{-z}}$. So, it depends.
What you did: $$\frac{1}{\sqrt{(z-2)e^{\pi i}}}=\frac{1}{\sqrt{z-2}\cdot\sqrt{e^{\pi i}}}=-\frac{i}{\sqrt{z-2}}$$Is not valid since $\sqrt{a}\cdot\sqrt{b}=\sqrt{ab}$ is not generally true.