What is the domain of $f^2$ if $f(x)=\sqrt{x+2}$
You have written $f^2(-5)=(f(-5))^2$. It is correct, however, look at the inside function of the RHS. It is $f(-5)$. Can you define $f(-5)$? No. That means $f^2(-5)$ is undefined. Similarly $f^2$ is undefined for any $x<-2$. So, your book is correct.
$f^2$ is the square of $f$. If $f$ is not defined, neither is $f^2$.
The textbook is correct. The domain of $f(x)=\sqrt{x+2}$ is $[-2,\infty)$ which therefore implies that the domain of $f^2(x)$ is also $[-2,\infty)$.
The new function that you constructed, $h(x)=x+2$, is the not the same as $f^2(x)$ since the domain of $h(x)$ is $(-\infty,\infty)$ while the domain of $f^2(x)$ is $[-2,\infty)$.