Hmm… I removed the 5000ms delay I added and changed in the settings to 5000ms, all works 
So I then changed in the settings to be 2000ms, and re ran the test expecting it to fail, but it worked.
My setup isn’t quite the same right now, I’m running this directly to the USB3 port on my mac, previously I was using it connect to a hub connect to a monitor connected to my laptop so maybe there was some delay there that was causing the errror?
When I get home I will test again and try to recreate the problem and see what happens.