Notice that \$R_{OUT} = g_{m2}r_{o2}(r_{\pi_2}||r_{o1}) + r_{o2} + r_{\pi_2}||r_{o1}\$
The proof can be found here:
finding the output resistance of bjt folded cascode
Thus, if we collect in terms of \$r_{o2}\$ we will end up with this:
\$R_{OUT} = \left(1 + g_{m2}(r_{\pi_2}||r_{o1})\right)r_{o2} + r_{\pi_2}||r_{o1}\$
but we can collect in terms of \$r_{\pi_2}||r_{o1}\$ therefore:
\$R_{OUT} = (1 + g_{m2}r_{o2})\cdot r_{\pi_2}||r_{o1} + r_{o2}\$
Conclusion there is an error in the book equation but numerically not a big error.