If we're pedantic, this doesn't actually do what's advertised, this would be waiting X timeouts worth of event cycles rather than just the one for a true Big timeout, assuming the precision matters when you're stalling a function for 40 days.
I haven’t looked at the code but it’s fairly likely the author considered this? eg the new timeout is set based on the delta of Date.now() instead of just subtracting the time from the previous timeout.
const subtractNextDelay = () => {
if (typeof remainingDelay === "number") {
remainingDelay -= MAX_REAL_DELAY;
} else {
remainingDelay -= BigInt(MAX_REAL_DELAY);
}
};