PG Bug reporting form <noreply@postgresql.org> writes:
> In version 14.0 RETURN QUERY with UPDATE RETURNING in a function is
> reporting an error and it works in version 13.4.
Thanks for the report! This was already reported and repaired [1],
so it should be okay in 14.1.
regards, tom lane
[1] https://www.postgresql.org/message-id/1F2F75F0-27DF-406F-848D-8B50C7EEF06A%40gmail.com