On Postgres 12, CTE's are not optimization fences anymore. [0]
[0] https://www.depesz.com/2019/02/19/waiting-for-postgresql-12-...
[0] https://www.depesz.com/2019/02/19/waiting-for-postgresql-12-...
That is: they mostly aren't a fence any more, but can be when you want them to, and sometimes still must be.