We could not reproduce the issue. Was there any chance “profile” had not been defined when the “else” condition was executed in the first iteration of the “loadVars” loop?
If possible, can you share the script with us? It’s unnecessary to be executable - just to make the investigation easier. You can send it to info@katalon.com.