Your experiment is not set to public so we can’t see it.
There does seem to be a memory issue with “every frame” code, you are not the only one reporting problems. See also: Update every frame doesnt work, Pavlovia: black screen and unable to continue (RAM issues)
However, that might not be what’s going on here. The fact that it lags only at the end of the task is unexpected. I take it you see no such behavior if you run it on your local machine in its Python form? I just want to make sure it’s not something odd in the task itself.
Also, how much delay are you we talking? Seconds? Minutes?