The index in that function is the index of the file in the list of output files, not the work item index. In this case, the 0 means the first file with that tag, while 1 would mean the second file with the tag (if it existed).
The work item index isn't needed because PDG evaluates the parameter against each work item, so all of the expression functions are computed with respect to a particular work item. If you select a work item dot in the UI, you can preview the evaluation w/ respect to that work item in the parameter interface by MMB-ing on the parm label.
Yep I checked after writing my post and realized the docs are quite unclear about how the function should be used. I'm going to update it today so it does a better job describing what the function arguments are.