Role permissions
You should grant the role that is trying to access from the JavaScript client to the custom schema.
Grant …. To (role) On (custom schema)
(Syntax sth like above. I didn’t verify it)
Grant …. To (role) On (custom schema)
(Syntax sth like above. I didn’t verify it)