That is after the recording, how to test another thing or test something or debug that stuff?
The 401 response code means ' "unauthorized"
Although the HTTP standard specifies "unauthorized", semantically this response means "unauthenticated". That is, the client must authenticate itself to get the requested response.
So the problem is related to authentication. If there is nothing obvious relating to this in the script, check for customization / headers.