It also happens to me when running a VirtualBox Windows'10 VM in my Mac (but not in a 'native' Win10 laptop). Is this your case?
It is due to some sort of conflict with the VM host, since the clipboard is shared. If I disable the shared clipboard in the VM, the error disappears.
Despite the error, at least in my case, the icon code is correctly copied to the clipboard.