Your test code is probably too fast for the browser. Try this as a little test, BEFORE the line in question:
WebUI.delay(10)
If that makes it work, you need to find a better way than using a fixed delay. WebUI.waitForElementVisible() perhaps? Or WebUI.waitForElementClickable() …