The errors occur based on your AN instructions. This is the case because the ANs produce their own code, if the prompt is ambiguous then it can create bad code for itself which leads to errors.
I would recommend optimizing your prompt.
Hope this helps!