The second argument of your function call to 'local:proces' is a string, which will later be bound to '$p as map(*)'. The returned error include line/column information, which should help you to find the buggy position in the code:
Stopped at typeBug 2025-05-14.xq, 14/73: [XPTY0004] Cannot convert xs:string to map(*): "test".