I can't share source code my company, it against policy.
Then write a new program that demonstrates the issue in a self contained way.
How is anyone supposed to help you if there's only a tiny fragment of the relevant code shown? And none of the runtime context, database state etc.
If you can't collect enough info to allow someone to see what's going on, you may wish to look at the various commercial support providers instead. That way you can have NDAs and so on. See https://www.postgresql.org/support/professional_support/ . Note that I work for one of them so I'm hardly independent.