Can you enable frontend debug logs and show me the output?
im not sure. You may have to debug it usng the debugger. In the first screenshot you sent, click on the normaliseUrlDomain.js phrase (in the stack trace) and add a breakpoint to it.
Then execute the code with the inspect element showing and you should see the debugger stop there and see what value is getting passed into that function