Retry of failed tests happening folder wise instead of individual API wise for test script written for collection

My question:
Test script for Collection running folder wise instead of API wise. Created the Test script for collection. When triggered the collection , retry of failed tests happening folder wise instead of individual API wise

Details (like screenshots):
image

If New Request-1 failed, i am expecting only New Request-1 should run as per the retry attempts configured.
But after execution of complete Folder-B, again complete Folder B run as per the retry attempts configured.

Test Scripts configured for collection:

var maxNumberOfTries = 3;
var sleepBetweenTries = 10000;

if (!pm.environment.get(“collection_tries”)) {
pm.environment.set(“collection_tries”, 1);
}

if ((pm.expect(pm.response.code).to.be.oneOf([200,201,202,204])) && (pm.environment.get(“collection_tries”) < maxNumberOfTries)) {
pm.environment.unset(“collection_tries”);
pm.test(“Successful request”, () => {
pm.expect(pm.response.code).to.be.oneOf([200,201,202,204]);
});

}
else {
var tries = parseInt(pm.environment.get(“collection_tries”), 10);
pm.environment.set(“collection_tries”, tries + 1);
setTimeout(function() {}, sleepBetweenTries);
postman.setNextRequest(request.name);
}