Ah, I was afraid of that. You’ve run into a bug that was reported by another user yesterday. The issue is that the tag you’re dealing with hasn’t been subscribed to (e.g. bound to) before you try to use it in scripting. This isn’t correct functionality, of course, but the workaround is to drop that tag onto a dummy label on the screen. You can even make that label invisible, if you want. Then your script will be able to fetch the tag correctly, once it has been used in a binding on an open window.
This will be fixed in 3.1.5.
Sorry for the inconvenience,