It seems to work when re-running, but these are random so there's probably a case where it fails... I wonder where the error condition is. Can you run it a few thousand times in a loop locally and see if it fails at all?