$\begin{aligned} & \therefore \cos ^{-1} x=\pi, \cos ^{-1} y=\pi \text { and } \cos ^{-1} z=\pi \\ & \therefore x=y=z=\cos \pi=-1\end{aligned}$
$\begin{aligned} & \therefore x^2+y^2+z^2+2 x y z \\ & =(-1)^2+(-1)^2+(-1)^2+2(-1)(-1)(-1)\end{aligned}$
$\begin{aligned} & =1+1+1-2 \\ & =3-2=1 .\end{aligned}$
Dividing both sides by $\sqrt{(1)^2+(-1)^2}=\sqrt{2}$, we get
$\frac{1}{\sqrt{2}} \cos \theta-\frac{1}{\sqrt{2}} \sin \theta=-\frac{1}{\sqrt{2}}$
$\therefore \cos \frac{\pi}{4} \cos \theta-\sin \frac{\pi}{4} \sin \theta=-\cos \frac{\pi}{4}$
$\therefore \cos \left(\theta-\frac{\pi}{4}\right)=\cos \left(\pi-\frac{\pi}{4}\right)$
$\ldots[\because \cos (\pi-\theta)=-\cos \theta]$
$\therefore \cos \left(\theta-\frac{\pi}{4}\right)=\cos \frac{3 \pi}{4}$
$\ldots(1)$
The general solution of $\cos \theta=\cos \alpha$ is
$\theta=2 n \pi \pm \alpha, n \in Z$
$\therefore$ the general solution of $(1)$ is given by
$\theta-\frac{\pi}{4}=2 n \pi \pm \frac{3 \pi}{4}, n \in Z$
Taking positive sign, we get
$\theta-\frac{\pi}{4}=2 n \pi+\frac{3 \pi}{4}, n \in Z$.
$\therefore \theta=2 n \pi+\pi=(2 n+1) \pi, n \in Z$
Taking negative sign, we get
$\begin{aligned} & \theta-\frac{\pi}{4}=2 n \pi-\frac{3 \pi}{4}, n \in Z . \\ & \therefore \theta=2 n \pi-\frac{\pi}{2}, n \in Z\end{aligned}$
$\therefore$ the required general solution is
$\theta=(2 n+1) \pi, n \in Z$ or $\theta=2 n \pi-\frac{\pi}{2}, n \in Z$.