If an action suddenly stops working, the most likely place to look for the bug is the part that you changed after it worked the last time. A wrong name length is not a likely reason unless you get an error message about it.

From your script snippet I cannot tell you where the bug is - but under "troubleshooting" in the manual there are many hints how to find and fix bugs.