The error appears to be that the camera cannot buffer commands and so capture fails when IO between the camera and PC is taking place. As this takes an indeterminate amount of time no amount of waiting between shots will fully resolve the problem.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
can you try insertign a short wait before the capture:
gphoto2 --wait-event=1s --capture-image-and-download
or perhaps 2s if this makes it more reliable?
The error appears to be that the camera cannot buffer commands and so capture fails when IO between the camera and PC is taking place. As this takes an indeterminate amount of time no amount of waiting between shots will fully resolve the problem.
might be fixed in 2.5.31