Do you have more than one instance of that script in the same flow? The scope is FlowElement which means that having multiple instances in the same flow should not have an impact because each instance will have its own global data, but perhaps it is a bug? Try with another tag name as well to see if it returns an empty string.