We are given the $x$ and $y$ coordinates of the four vertices of a rectangle. How do I find the $z$-coordinates?
I know that this 3 dimensional rectangle must obey all the usual conditions of rectangle. Opposite sides are equal. The angles between two adjacent sides are 90 degrees.
Suppose you have coordinates $A(x_A,y_A), B(x_B,y_B), C(x_C,y_C),D(x_D,y_D)$, taking them clockwise around the rectangle.
You will note that these probably don't look like a rectangle if drawn in the 2D plane. That's because you don't have the z-coordinates.
Let's assume that the z-coordinate of A is $0$.
Find the vectors $AB$ and $AD$ and make it so that $AB . AD =0$
$AB = \begin{bmatrix} x_B-x_A\\ y_B-y_A \\ z_B -0\end{bmatrix}$
$AD = \begin{bmatrix} x_D-x_A\\ y_D-y_A \\ z_D -0\end{bmatrix}$
$AB.AD=0 \Rightarrow \begin{bmatrix} x_B-x_A\\ y_B-y_A \\ z_B -0\end{bmatrix} . \begin{bmatrix} x_D-x_A\\ y_D-y_A \\ z_D -0\end{bmatrix} = 0$
$(x_B-x_A)(x_D-x_A)+(y_B-y_A)(y_D-y_A)+z_Bz_D=0$
$z_Bz_D=-(x_B-x_A)(x_D-x_A)-(y_B-y_A)(y_D-y_A)$
You can choose any pair of values $z_B, z_D$ that make this true.
Now you have full sets of coordinates for A, B and D. The final stage is to find C.
Note that $AB = DC$ (parallel sides of a rectangle). So $OC = OD + DC = OD + AB$
In particular, $z_C= z_D + (z_B-z_A)$
Worked example
Consider these points: $A(3,3,z_A), B(10,5,Z_B), C(11,8,z_C), D(4,6,z_D)$
Let $z_A=0$.
$AB = \begin{bmatrix} 7\\ 2 \\ z_B \end{bmatrix}$
$AD = \begin{bmatrix} 1\\ 3 \\ z_D \end{bmatrix}$
$AB.AD=0 \Rightarrow 7+6+z_Bz_D=0$
$z_Bz_D=-13$
Choose $z_B=-1$ and $z_D=13$
We now have $A(3,3,0), B(10,5,-1), C(11,8,z_C), D(4,6,13)$
$DC = AB = \begin{bmatrix} 7\\ 2 \\ -1 \end{bmatrix}$
$OD \begin{bmatrix} 4\\ 6 \\ 13 \end{bmatrix}$
$OC = OD + DC = \begin{bmatrix} 7\\ 2 \\ -1 \end{bmatrix}+\begin{bmatrix} 4\\ 6 \\ 13 \end{bmatrix} = \begin{bmatrix} 11\\ 8 \\ 12 \end{bmatrix}$
Final set of points: $A(3,3,0), B(10,5,-1), C(11,8,12), D(4,6,13)$