You should not assume the files will be processed in the order you think. Especially with APFS, the file order is much more unpredictable.
Instead of using the # (counter) attribute to number them in the order they happen to be processed, it might be better to use a custom attribute to match the number part and re-use that in the Rename pattern.