Pass value of type 'Set' to custom sql function

Why don’t you update to Hibernate ORM 6.4+ which already has these functions?
I don’t know how your model looks like or what the value of the collection actually is, but maybe there is a bug hiding. So please try to create a reproducer with our test case template and if you are able to reproduce the issue, create a bug ticket in our issue tracker and attach that reproducer.