script bug in monthly timeframe

 
Hello friends!
I wrote a script in which I used the following code


Print("111");
x=iTime(_Symbol, PERIOD_MN1,0);
Print("222");

When the execution of the code reaches this part, the execution of the script stops

So that the print is executed before it but the print is not executed after it. This means that the script is exactly stopped in this part. The script is running on the chart but has not continued.

This issue is only in monthly time frame and sometimes in weekly ...

Does anyone know what the problem is?
Reason: