Experiment with line 2 by increasing the number of zeros in the file name.
Strings behave this way:
"0" ≠ "00" ≠ "000" ≠ "0000" ≠ "00000"
Integers behave this way:
0 = 00 = 000 = 0000 = 00000
The Finder is behaving as if a sub-string of zeros is equivalent to zero,
which is erroneous integer behavior, not correct string behavior.
In my script, above, the Finder incorrectly thinks that:
"x0y" = "x00y" = "x000y" = "x0000y" = "x00000y"
Perhaps I should post this message as a bug report,