I have run this code thousands of times without errors. One day it fails. Reran with the same data and it worked! Both runs were inside a docker container so should be identical