Is the file local to your computer or one that is hosted over a network from another machine? (Can't save a copy from a hosted file...)

There's a generic error message that pops up when FileMaker tries to create a new file and can't. Its text tends to be misleading as the most common cause of an error is some picky little error in the specified file path that renders the path invalid. That might be the source of your trouble here.

Open the file and insert a file from the location to which you want to save a copy into the container field with the "by reference" option specified. Then compare the file path that your script is calculating to the file path extracted by calculation fields from the container field to see if you can spot the difference in file paths.

I have also observed that the precise File path to Drop box is not identical from computer to computer due to differences in OS version.