Bear in mind that CTEs act as an optimization fence, so the filter (rn=1) wont be pushed to the CTE. The CTE will be materialized and only then the filter will be applied. I believe pg12 will change this behaviour.
https://www.depesz.com/2019/02/19/waiting-for-postgresql-12-...