If you are given the angle ($\alpha$) of the projection of the vector on the XZ plane, taken from X,
then it means that the projection lies on the line $z=\tan \alpha \, x$, i.e that the vector
lies on the plane
$$
\pi _{\,x\,z} :\quad x\sin \alpha - z\cos \alpha = 0
$$
Similarly for the angle $\beta$ rising from Y on the YZ plane we get
$$
\pi _{\,y\,z} :\quad y\sin \beta - z\cos \beta = 0
$$
Visually this is rendered by the following sketch

That means that the vector is normal to both the normals of the planes, which gives
$$ \bbox[lightyellow] {
\eqalign{
& {\bf r} = \pm \left| {\bf r} \right|\;{{{\bf n}_{\,{\bf \alpha }} \times {\bf n}_{\,{\bf \beta }} } \over {\left| {{\bf n}_{\,{\bf \alpha }} \times {\bf n}_{\,{\bf \beta }} } \right|}} = \cr
& \; = \pm \left| {\bf r} \right|\;\left[ {\left( {\matrix{ {\sin \alpha } \cr 0 \cr { - \cos \alpha } \cr
} } \right) \times \left( {\matrix{ 0 \cr {\sin \beta } \cr { - \cos \beta } \cr
} } \right)} \right]_{\,norm} = \cr
& = {{ \pm \left| {\bf r} \right|} \over {\sqrt {\cos ^{\,2} \beta \sin ^{\,2} \alpha + \sin ^{\,2} \beta } }}\;
\left( {\matrix{ {\cos \alpha \sin \beta } \cr {\cos \beta \sin \alpha } \cr {\sin \alpha \sin \beta } \cr
} } \right) = \cr
& = {{ \pm \left| {\bf r} \right|\;2\sqrt 2 } \over {\sqrt {6 - \cos \left( {2\left( {\alpha + \beta } \right)} \right) - \cos \left( {2\left( {\alpha - \beta }
\right)} \right) - \cos \left( {2\alpha } \right) - \cos \left( {2\beta } \right)} }}\; \cdot \cr
& \cdot \left( {\matrix{ {\cos \alpha \sin \beta } \cr {\cos \beta \sin \alpha } \cr {\sin \alpha \sin \beta } \cr
} } \right) \cr}
} \tag{1}$$
where the sign is to be taken appropriately: it will be plus
if the direction of the vector is chosen according to the "right hand rule".
Note that the expression for the vector is fully compatible wrt the exchange of $\alpha, \beta$
as it should be.
Also note that
$$ \bbox[lightyellow] {
{{r_{\,z} } \over {r_{\,x} }} = \tan \alpha \quad {{r_{\,z} } \over {r_{\,y} }} = \tan \beta
} $$
as required.
And finally note that the expression above is fully defined
for $0 < |\alpha|,\, |\beta| < pi$, as well as
for $ |\alpha| =0, \, \pi$ if $\beta \ne 0$
$$
{{\bf r} \over {\left| {\bf r} \right|}} = \left\{ {\matrix{
{\left( {1,0,0} \right)^T } & {\left| {\,\alpha = 0,\beta \ne 0} \right.} \cr
{\left( {0,\cos \beta ,\sin \beta } \right)^T } & {\left| {\,\alpha = \pi /2,\forall \beta } \right.} \cr
{\left( { - \sqrt 2 \sin \beta \,\mathop /\limits_{} \sqrt {1 - \cos \left( {2\beta } \right)} ,0,0} \right)^T } & {\left| {\,\alpha = \pi ,\;\beta \ne 0} \right.} \cr
} } \right.
$$
--- Conclusion ---
In reply to your comment, consider that the formula (1) above simply translates into
$$ \bbox[lightyellow] {
\left\{ \matrix{
x = r{{\cos \alpha \sin \beta } \over {\sqrt {\cos ^{\,2} \beta \sin ^{\,2} \alpha + \sin ^{\,2} \beta } }}\; \hfill \cr
y = r{{\cos \beta \sin \alpha } \over {\sqrt {\cos ^{\,2} \beta \sin ^{\,2} \alpha + \sin ^{\,2} \beta } }} \hfill \cr
z = r{{\sin \alpha \sin \beta } \over {\sqrt {\cos ^{\,2} \beta \sin ^{\,2} \alpha + \sin ^{\,2} \beta } }} \hfill \cr}
\right.\quad \Leftrightarrow \quad \left\{ \matrix{
r = \sqrt {x^{\,2} + y^{\,2} + z^{\,2} } \; \hfill \cr
{z \over x} = \tan \alpha \hfill \cr
{z \over y} = \tan \beta \hfill \cr} \right.
}\tag{1.a}$$