API execution in a mongoDB Atlas database trigger [API limit or async function trigger] bis

Hi all,

I have created a database trigger in Mongodb Atlas which is executed when a collection gets updated.
The trigger function, when executed, calls four api endpoints. (1 GET and 3 PUT’s).
You will find the trigger function below. The function is an async function because of the API calls.

exports = async function(changeEvent) {
    //Access the _id of the changed document:
  const lotteryID = changeEvent.documentKey._id;
  //Access the latest version of the changed document
  const fullDocument = changeEvent.fullDocument;
  const updateDescription = changeEvent.updateDescription;
  //See which fields were changed (if any):
  if (updateDescription) {
      const updatedFields = updateDescription.updatedFields; // A document containing updated fields
      //verify if there are no slots open
      if (parseInt(updatedFields.lotteryOpenLots) === 0){
        const vurlClosingLottery = 'PUT_API_URL1/' + lotteryID; 
        const responseCloseLottery = await context.http.put({ url: vurlClosingLottery });
        const vurlPickWinner =  'GET_API_URL2/' + lotteryID;
        const responsePickWinner = await context.http.get({ url: vurlPickWinner });
        const responsePickWinner2JSON = EJSON.parse(responsePickWinner.body.text());
        const vlotteryUserWinner = responsePickWinner2JSON._id;
        const userPhoneNumber = responsePickWinner2JSON.userPhoneNumber;

        const vurlSetLotteryWinner =  'PUT_API_URL3/' + lotteryID;
        const responseSetLotteryWinner = await context.http.put({ url: vurlSetLotteryWinner, body: {lotteryUserWinner: vlotteryUserWinner},encodeBodyAsJSON: true });
        const vuserLotteryWin = lotteryID;
        const vurlSetUserWinner ='PUT_API_URL4/' + vlotteryUserWinner;
        const responseSetUserWinner = await context.http.put({ url: vurlSetUserWinner, body: {userLotteryWin: vuserLotteryWin},encodeBodyAsJSON: true });
        console.log(responseSetUserWinner.status); //500 Internal Server Error
        const responseSetUserWinner2JSON = EJSON.parse(responseSetUserWinner.body.text());
        const responseSetUserWinnerMessge = responseSetUserWinner2JSON.message;


Among the 4 calls, 3 calls succeed and one fails (the last PUT in the code), which throws a 500 status code (request response). The same PUT call with the exact URI and same body key (userLotteryWin) works via Postman. I do not understand why the call doesn’t go thru on Atlas but does on Postman.
Also, the last two PUT’s are constructed fundamentally the same way in the trigger function, but the last PUT doesn’t go thru where as the other one does.

Is there a limit of API calls in a trigger function ? (stupid question but after all no such thing as a stupid question)
Is it related to the async/await ?

Any pointers, suggestions, comments are welcome.
Thanks for the help,