I have the following code to demonstrate the issue:

```
let count = 5;
while (count--) {
    setTimeout(() => {
        console.log('timeout');
        process.nextTick(() => {
            console.log('tick');
        });
    }, 0);
}

const largeNumber = 20000;
for (let i = 0; i < largeNumber; i += 1) {
    for (let j = 0; j < largeNumber; j += 1) {
        // do nothing here, just be sure all the setTimeout callbacks are in the queue when exiting sync code
    }
}

```

The output I expect is the following:

```
timeout
tick
timeout
tick
timeout
tick
timeout
tick

```

Because the event loop checks the `timeouts` queue, it founds the first `setTimeout` callback, runs it, and check the `nextTick` queue after. And for the further `setTimeout` callbacks it should do the same.

But I get the following output:

```
timeout
timeout
timeout
timeout
timeout
tick
tick
tick
tick
tick

```

Why?