Another way to solve this is through rotation matrices (or homogeneous matrices). (this actually is a very basic problem in inverse kinematics of robotics).
The rotation matrices about axis Y and Z by an angle $\theta$ are given by
$$R_y(\theta) = \begin{bmatrix}\cos\theta & 0 & -sin\theta \\0& 1&0 \\sin\theta & 0& \cos\theta \end{bmatrix} \qquad R_z(\theta) = \begin{bmatrix}\cos\theta & -sin\theta & 0\\ sin\theta& \cos\theta& 0 \\0& 0&1\end{bmatrix} $$
assuming that
- axis z is the horizontal one (aligns with the bearing of the larger frame) and
- axis y is the vertical (aligns with the bearing of the inside frame when the larger and smaller frames are aligned and vertical - hopefully the following depiction will explain what I mean )

Figure : Global X,Y,Z axis (in perspective). The position of the machine is arbitrary (the alignment of X axis is only by chance!)
Please note that:
- GLOBAL Z-axis is aligned with the outer frame bearings,
- GLOBAL Y axis is vertical, and
- GLOBAL X is perpendicular to the other two ( I just noticed that the direction should be opposite to obey the right hand rule, but I won't bother making another )
Then the overall rotation matrix, for the outside frame rotating by $\theta$, and the inside rotating by $\phi$ then its:
$$R_y(\phi) R_z(\theta) = \begin{bmatrix}\cos\theta & 0 & sin\phi\\0& 1&0 \\ -sin\phi & 0& \cos\phi \end{bmatrix} \begin{bmatrix}\cos\theta & -sin\theta & 0\\ sin\theta& \cos\theta& 0 \\0& 0&1\end{bmatrix} $$
or
$$R_y(\phi) R_z(\theta) = \begin{bmatrix} \cos\left(\phi \right)\,\cos\left(\theta \right) & -\sin\left(\theta \right) & \cos\left(\theta \right)\,\sin\left(\phi \right)\\ \cos\left(\phi \right)\,\sin\left(\theta \right) & \cos\left(\theta \right) & \sin\left(\phi \right)\,\sin\left(\theta \right)\\ -\sin\left(\phi \right) & 0 & \cos\left(\phi \right) \end{bmatrix}$$
The way you'd use this, assuming that the initial position normal (inside and outside aligned and vertical) is $e_{n,0}= \begin{bmatrix} 1\\ 0\\ 0\end{bmatrix}$, is that you'd multiply:
$$R_y(\phi) R_z(\theta) e_{n,0} = \begin{bmatrix} \cos\left(\phi \right)\,\cos\left(\theta \right)\\ \cos\left(\phi \right)\,\sin\left(\theta \right)\\ -\sin\left(\phi \right) \end{bmatrix}$$
Now assuming for example that the new normal is $e_{n,1} = \begin{bmatrix} 0\\ 1\\ 0\end{bmatrix}$
then simply have:
$$\begin{bmatrix} \cos\left(\phi \right)\,\cos\left(\theta \right)\\ \cos\left(\phi \right)\,\sin\left(\theta \right)\\ -\sin\left(\phi \right) \end{bmatrix} = \begin{bmatrix} 0\\ 1\\ 0\end{bmatrix}$$
or (equally) the following three equations:
$$
\begin{cases}
\cos(\phi )\,\cos(\theta ) =0\\ \cos(\phi )\,\sin(\theta )=1\\ -\sin(\phi )=0
\end{cases}$$
NOTE: this condition applies to any normal so you don't need to recalculate the above. You only need to solve the above system.
To solve the system:
$$
\begin{cases}
\cos(\phi )\,\cos(\theta ) =0\\ \cos(\phi )\,\sin(\theta )=1\\ -\sin(\phi )=0
\end{cases} \rightarrow \begin{cases}
\cos(\phi )\,\cos(\theta ) =0\\ \cos(\phi )\,\sin(\theta )=1\\ \color{red}{\phi= 0 \text{ or } \phi= \pi}
\end{cases}
\rightarrow \begin{cases}
\text{if } \phi= 0 \begin{cases}
\color{red}{1}\,\cos(\theta ) =0\\ \color{red}{1}\,\sin(\theta )=1
\end{cases}\\
\text{if } \phi= \pi \begin{cases}
\color{red}{-1}\,\cos(\theta ) =0\\ \color{red}{-1}\,\sin(\theta )=1
\end{cases}
\end{cases}
\rightarrow \begin{cases}
\text{if } \phi= 0 \color{red}{\text{ then } \theta=\frac{\pi}{2}} \\
\text{if } \phi= \pi \color{red}{\text{ then } \theta=-\frac{\pi}{2}}
\end{cases}
$$
This is an example that shows that you can achieve the same position with two different angle configurations.