I see no mention of payload in the debug output, hmm? I do see msgerror and message.
Have you tried using the copy path button that appears when you hover the cursor over message property name in the debug panel?
sorry ... i can't reproduce it now... i need some time to reproduce it....
i hope i need one of two hours (but i have use the copy path button behind the message)
It is always msg when it enters or outputs a function node, after that you can use any property name you wish. Using copy path you should always add msg when using it in a function node.
As this is an error it is sent in msg.error, as payload is probably carrying other data.