Recover bad loop iteration

If you mean that the Python Script node is producing an empty table or missing data then maybe this discussion i useful:

BW/Evert