A CTE probably would have fixed it, but we weren't able to use them. We were using Citus which at the time didn't support CTEs.
Using a CTE to do this would also be suboptimial since it materializes the entire result of the subquery in memory. This is as opposed to the OFFSET 0 which would only materialize one row at a time.