Could you double check it?
We’re testing your failing code, not that PostgreSQL is working as intended. Suggest you get rid of all the stuff that doesn’t produce errors and focus on trying to supply a minimal script that produces the unexpected error. Then send that as a single email, probably with an attachment and some explanations.
David J.