When recording a script with NTLM the first request usually contains already the header field
Authorization: NTLM <...>
which leads to an authentication.
When the script is executed from EEM executor (Editor or on Robot) the first request does not contain this header field and the response contains the header field
To set the header field and send the request again the script executor type can be changed from xml to xmlretry in the script configuration: