Collection running in Postman but not with newman

Your question may already have an answer on the community forum. Please search for related topics, and then read through the guidelines before creating a new topic.

Here’s an outline with best practices for making your inquiry.

My question: I am getting following error in Newman but not in postman collection

this is my code in collection pre script
reading external file for body payload

then in the request script i am using this variable to traverse and get my payload object

when i run getting # failure detail

  1. TypeError Cannot read properties of undefined (reading ‘0’)
    at prerequest-script
    inside “ManufacturerInterface / InvoiceRequest”

Details (like screenshots):

How I found the problem:

I’ve already tried: