Feed the output of the function node into a debug node which is set to show the complete message. Then look at what you are getting to see where the problem lies.
The problem is the msg.url you are constructing contains {payload}. That syntax only works when you enter it the URL field of node.
If you pass in msg.url then it uses it exactly as you provide it.
So change your function to include msg.payload in the string directly. I would show you what I mean, but I can't copy and paste your code from a screenshot.