Dynamo routine crashed

Hello guys

I have a file with a little problem. When the file is open and run in manual mode, everything is ok, but when I change the run mode to automatic, the routine crashed.

Thanks