We have recently been getting the error message "user is locked" when trying to call a function in a script (RFC). We unlock the user in the system, but after a while the error message returns.
Most likely one of the users has an incorrect RFC password in his GuiXT profile (or wrong guixt.ini file). The SAP system locks the RFC user automatically after a certain number of wrong attempts.