The command is checking where you mouse cursor is, or what was the last manager to be active. If you use the regular command (U~W) you will have different result depending on where your mouse cursor is.
It's the same for the CallCommand. So if you drag and drop the script manager icon to a palette, you will be able to execute the command and got the same result.
Another workaround is to open a UV windows before calling the command.
This will make the UV manager to be the last active windows and your command will work as expected. But you will not be able to close that windows.
I'll send an email to our devs to see if it's intended or not, specially when you are have UVMode activated.