Error: function timed out, ensure the promise resolves within XXX, with implicit wait (nightwatch cucumber)

Nightwatch with Cucumber. I want to check if the elements listed in an Excel sheet are present on the webpage. To do this, a sequential promise(using reduce) is written to ensure that the page loads and each element is verified.

When test is ran, the element verification works fine using waitForElementVisible if the element is present . However, when an element is not present, “Error: function timed out, ensure the promise resolves within 50000 milliseconds” issue is encountered.

I tried increasing the implicit wait time using client.waitForElementVisible(record[“Locator”],60000);
, but it also fails. Now, I get both the “Error: function timed out, ensure the promise resolves within 50000 milliseconds” and a “Timed out while waiting for element to be present for 60000 milliseconds”

    const sheetData = file[sheetName];
    return sheetData
        .reduce((promiseChain, record, index) => {
            return promiseChain.then(() => {
                return page.load(param)// Adjust timeout as needed
                    .then(() => {
                        return page.waitForPageLoad();
                    })
                    .then(async() => {
                        await client.waitForElementVisible(record["Locator"],60000);   //FAILS AT THIS STEP

                    })
                    .then(() => {
                        results.push({ "status": "fulfilled", index: index + 1 });
                    })
                    .catch((error) => {
                        results.push({ "status": "rejected", index: index + 1, error});
                        return Promise.resolve(); 
                    });
            });
        }, Promise.resolve())
        .then(() => {
            const failures = results.filter((result) => result.status === "rejected");
            if (failures.length > 0) return Promise.reject(failures);
            return Promise.resolve(true); 
        }).catch((finalError) => {
            console.error("Final errors encountered: ", finalError);
        });

When additional timeout is provided as in

client.waitForElementVisible(record["Locator"],60000);
 
 Error: function timed out, ensure the promise resolves within 50000 milliseconds
          at Timeout.<anonymous> (C:[email protected]:54:20)     
          at listOnTimeout (node:internal/timers:573:17)
          at process.processTimers (node:internal/timers:514:7)

 Timed out while waiting for element  to be present for 60000 milliseconds. - expected "visible" but got: "not found" 

When no timeout/<60000 millisec timeout is provided:

client.waitForElementVisible(record["Locator"]);  OR 
 client.waitForElementVisible(record["Locator"],10000);
    Error: function timed out, ensure the promise resolves within 50000 milliseconds
              at Timeout.<anonymous> (C:[email protected]:54:20)     
              at listOnTimeout (node:internal/timers:573:17)
              at process.processTimers (node:internal/timers:514:7)

and chrome process still runs(browser not closed)

chrome browser tests exited with code: 1
error: .api.url() returned a value that is not a string, probable cause is an alert popup! {"timestamp":"2024-08-09T03:10:19.369Z"}
error: null {"timestamp":"2024-08-09T03:10:19.372Z"}
error: .api.url() returned a value that is not a string, probable cause is an alert popup! {"timestamp":"2024-08-09T03:10:19.906Z"}
error: null {"timestamp":"2024-08-09T03:10:19.907Z"}
error: .api.url() returned a value that is not a string, probable cause is an alert popup! {"timestamp":"2024-08-09T03:10:20.448Z"}
error: null {"timestamp":"2024-08-09T03:10:20.448Z"}

Also tried using Promise.race by creating a customTimeout(40000, 70000) as below

return page.load(param)
                        .then(() => {
                            return page.waitForPageLoad();
                        })
                        .then(() => {
                            const timeoutPromise = new Promise((_, reject) =>
                                setTimeout(() => reject(new Error(`Timeout waiting for element: ${record["Locator"]}`)), 40000) 
                            );
                            const elementPromise = new Promise((resolve, reject) => {
                                client.element('css selector', record["Locator"], function(result) {
                                    if (result.status != -1) {
                                        resolve(result);
                                    } else {
                                        reject(new Error(`Element not found: ${record["Locator"]}`));
                                    }
                                });
                            });
                            return Promise.race([elementPromise, timeoutPromise]);
                        })

both resulted in

Error: function timed out, ensure the promise resolves within 50000 milliseconds
          at Timeout.<anonymous> (C:[email protected]:54:20)     
          at listOnTimeout (node:internal/timers:573:17)
          at process.processTimers (node:internal/timers:514:7)

As the list of elements/pages to verify are dynamically changes(adobe analytics), I cannot give timeout at step level(as suggested in few answers), as this depends on the excel records and any step level time out may stop reading records.

Can you please suggest how to bypass the “function timeout” error and instead only track the elements that are not available, continuing to check for the remaining elements even if one is not found?