I've attached patches of this fix for PG14 and PG15. Could you please try the same scenario again with these patches and see if the issue happens?
pgsql-bugs by date:
Соглашаюсь с условиями обработки персональных данных