it seems there's something wrong with CTE inlining when there's a view containing a correlated subquery referencing the CTE.
pgsql-hackers by date:
Соглашаюсь с условиями обработки персональных данных