`DELETE ... RETURNING ...` works just perfectly (well, as perfectly as such an ill-considered thing can work). The statement is, however, ill-conceived. You cannot use `DELETE ... RETURNING ...` in the manner used because it is a delete statement, not a projection statement, and only projection statements are permitted in nested projections.