The following real $2 \times 2$ matrix has determinant $1$:

$$\begin{pmatrix} \sqrt{1+a^2} & a \\ a & \sqrt{1+a^2} \end{pmatrix}$$

The natural generalisation of this to a real $2 \times 2$ block matrix would appear to be the following, where $A$ is an $n \times m$ matrix:

$$\begin{pmatrix} \sqrt{I_n+AA^T} & A \\ A^T & \sqrt{I_m+A^TA} \end{pmatrix}$$

Both $I_n+AA^T$ and $I_m+A^TA$ are positive-definite so the positive-definite square roots are well-defined and unique.

Numerically, the determinant of the above matrix appears to be $1$, for any $A$, but I am struggling to find a proof. Using the Schur complement, it would suffice to prove the following (which almost looks like a commutativity relation):

$$A\sqrt{I_m + A^TA} = \sqrt{I_n + AA^T}A$$

Clearly, $A(I_m + A^TA) = (I_n + AA^T)A$. But I'm not sure how to generalise this to the square root. How can we prove the above?