Not sure this will help much, but when I first generate the files (ImageMagick) that I later want to combine into a video, I append on a suffix: filename"_0000".png, filename"_0001".png, etc., and then when I call ffmpeg, I don't feed it a list, I just turn it loose in the subdirectory containing the files with:
ffmpeg -r 30 current_directory/filename_%4d.png -vcodec libx264 -pix_fmt yuv420p
Maybe your script isn't ingesting mylist.txt correctly, and getting hosed up? Using a new naming convention, with "$4d" instead of feeding it a .txt list, should test that.
Note: "filename" is just one string, never changing, for all files.
I would say I'm something of a "just bangin' two rocks together" type of programmer, fair warning.