[HELP]Cash Register project (JAVA SCRIPT)

Currently I am stuck at the 3rd test case. Apparently my code is working fairly well with larger denominations of money till “Quarter” but, when I go lower than that it suddenly stops functioning properly and I get a returned statement of {status: “INSUFFICIENT_FUNDS”, change: []} from the function. Please help!!!
Problem Link - https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/javascript-algorithms-and-data-structures-projects/cash-register/
Code explanation - checkCashRegister() function calls returned() function where all of the work is done. Meaning returned calls itself recursively till it reaches a conclusion.

//change stores money left to be returned after previous call back
//cid stores the money left in cash counter after the previous call back
// denomination stores the array money containing values corresponding(index) to the name of the money denomination in cid.
// passedl is the point from which I want my for loop to start itterating
// cidr is the array of currency which will be the value of change property of returned object

function returned(change,cid,denomination,passedl,cidr) {
  var sum = cid.map(index=>index[1]).reduce((sum,index)=>sum+index); //summing the leftover cash in cashmachine
  
  if(change==0&&sum==0)
  {
    return {status: "CLOSED", change: cidr};
  }
  else if(change==0&&sum!=0)
  {
    return {status: "OPEN", change: cidr};
  }
  for(let i=passedl;i>0;i--)
  {
    if(denomination[i]<=change&&cid[i][1]!==0)
    {
      let flag=0;
      change = change - denomination[i];
      cid[i][1]-=denomination[i];
      for(let j =0;j<cidr.length;j++)   //checking if denomination allredy exists in cidr 
      {
        if(cidr[j][0]==cid[i][0])
        {
          flag=1;
          cidr[j][1]+=denomination[i];
        }
      }
      if(flag==0) cidr.push([cid[i][0],denomination[i]]); //if not then this step is executed
      let temp  = returned(change,cid,denomination,i,cidr);
      if(temp.status=="OPEN"||temp.status=="CLOSED")
      {
        return temp;
      }
  
    }

  }
  return {status: "INSUFFICIENT_FUNDS", change: []};
}
function checkCashRegister(price, cash, cid) {
       var denomination = [0.01,0.05,0.10,0.25,1,5,10,20,100];
  return returned(cash-price,cid,denomination,denomination.length-1,[]);
}

// Example cash-in-drawer array:
// [["PENNY", 1.01],
// ["NICKEL", 2.05],
// ["DIME", 3.1],
// ["QUARTER", 4.25],
// ["ONE", 90],
// ["FIVE", 55],
// ["TEN", 20],
// ["TWENTY", 60],
// ["ONE HUNDRED", 100]]

console.log(checkCashRegister(3.26, 100, [["PENNY", 1.01], ["NICKEL", 2.05], ["DIME", 3.1], ["QUARTER", 4.25], ["ONE", 90], ["FIVE", 55], ["TEN", 20], ["TWENTY", 60], ["ONE HUNDRED", 100]]));

INPUT
console.log(checkCashRegister(3.26, 100, [[“PENNY”, 1.01], [“NICKEL”, 2.05], [“DIME”, 3.1], [“QUARTER”, 4.25], [“ONE”, 90], [“FIVE”, 55], [“TEN”, 20], [“TWENTY”, 60], [“ONE HUNDRED”, 100]]));

should return
`{status: “OPEN”, change: [[“TWENTY”, 60], [“TEN”, 20], [“FIVE”, 15], [“ONE”, 1], [“QUARTER”, 0.5], [“DIME”, 0.2], [“PENNY”, 0.04]]}

is returning
{status: “INSUFFICIENT_FUNDS”, change: []}`