'Snowflake UDF is giving the error - Unsupported subquery type cannot be evaluated

I am getting this error on doing a select on UDF - "Unsupported subquery type cannot be evaluated", the parameters of the UDF are coming from the joins but not sure what is going wrong here. I have tried every suggestions but it is not working

It is SQL UDF - returning a varchar.

Any help will be appreciated



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source