Can't get filerename statement to work

I’ve posted as a follow-up to this thread rather than create a new one because I suspect they’re related.

The databaseexportcsv statement works fine if I stay in my own paddock (ie, no path data preceding the file name) but if I put any sort of path into the parameter it fails with an error message like this:

Screen Shot 2021-12-20 at 1.50.36 pm

Is this a bug or am I missing something?