There is no go to layout step. THat may or may not cause a problem, but steps that start with "insert"---such as insert picture cannot insert data unless the target field is present on the current layout.
I would not move the Go To field script step except maybe to put it after the set variable step.
thanks PhilModJunk, I added the go to layout but can't see how that was the problem in this instance since I know what layout it was always run from. I thought the script would run faster looping through 4000plus records by taking the Go To Field script outside of the loop & before it. We don't have images for every WO so I simply ignored errors.
The risk to pulling the go to field out of the loop is more than the slight change in speed is worth. The change from record to record could, in some cases move the focus to the wrong field. It might not at the moment, but a future change in the layout might. In fact, using a utility layout for this script with no script triggers and which is never exposed to the user would be a very good idea.
You haven't really indicated exactly how this is inconsistent, BTW. A more detailed description of how it fails when it fails may clue some of us in as to possible issues.
For example, when it fails, does it fail for all records that the script tries to insert, or does one iteration of this loop insert a record and the next one does not.
As far as I can tell - script runs fine but after running it I find one of the images didn't actually get inserted. When I re-run it it does get inserted. The record happened to be somewhere in the middle of the sorted records. That is all I know.