Can't get timer.setTimeout() to work

You shouldn’t be doing this in your void loop. You need to use an interval timer.

I don’t think you fully understand how the timeout timers are being triggered. You would need to add some serial print statements to understand when they are starting and stopping.

If you read the Timeout Timers section of this tutorial, especially the part that starts…

then add messages in your code that tell you when each of the timeout timers are starting and ending, you’ll have a better idea of the code execution sequence.

Pete.