This is an alternative solution following the Hartley & Zisserman [1] notation which is commonly used in stereo vision. Note, while the above formulation is fine, this one assigns the rotated camera origin in the respective camera frame to $t = -R \tilde{C}$, where $\tilde{C}$ corresponds to the camera origin in world coordinates.
We have two transformation matrices $T_1 = [R_1 | t_1]$ and
$T_2 = [R_2 | t_2]$ and are interested to find the transformation $T_{1->2}$ that transforms a point from coordinate frame $T_1$ into $T_2$.
From the camera transformation equation we get:
\begin{gather*}
x_{c_1} = R_1 x_w + t_1 \\
x_w = R_1^T (x_{c_1} - t_1) \\
\end{gather*}
$x_w$ is a point in world coordinates.
$x_{c_1}$ corresponds to the world point $x_w$ expressed in the first frame's local coordinate system.
and we also have:
\begin{gather*}
x_{c_2} = R_2 x_w + t_2
\end{gather*}
$x_{c_2}$ corresponds to the world point $x_w$ expressed in the second frame's local coordinate system.
Note, and this is the important difference to the above. $t_1$ and $t_2$ are expressed in their local frame's coordinate system respectively. They are not in world coordinates.
When substituting $x_w$ it follows:
\begin{gather*}
x_{c_2} = R_2 (R_1^T (x_{c_1} - t_1)) + t_2 \\
x_{c_2} = R_2 R_1^T x_{c_1} - R_2 R_1^T t_1 + t_2 \\
\end{gather*}
and when we substitute $t_1$ and $t_2$ with $-R_1 \tilde{C_1}$ and $-R_2 \tilde{C_2}$ respectively:
\begin{gather*}
x_{c_2} = R_2 R_1^T x_{c_1} - R_2 R_1^T (-R_1 \tilde{C_1}) + (-R_2 \tilde{C_2}) \\
x_{c_2} = R_2 R_1^T x_{c_1} + R_2 \tilde{C_1} - R_2 \tilde{C_2} \\
x_{c_2} = R_2 R_1^T x_{c_1} + R_2 (\tilde{C_1} - \tilde{C_2})
\end{gather*}
With the same argument and simplification this can be re-written as:
\begin{gather*}
T_{12} =
\begin{bmatrix}
R_2 R_1^T & -R_2 (\tilde{C_2} - \tilde{C_1}) \\
0 & 1
\end{bmatrix}
\end{gather*}
or with $R_{12} = R_2 R_1^T$ and $t_{12} = -R_2 (\tilde{C_2} - \tilde{C_1})$
\begin{gather*}
T_{12} =
\begin{bmatrix}
R_{12} & t_{12} \\
0 & 1
\end{bmatrix}
\end{gather*}
I hope this helps.