While not completely the same, i have seen similar issue using dynamically concatenated strings as opposed to defining in a variable and then using that - i mention this in another post (linked below). I assume this is an issue in the script execution that does the joining “late” to calling the function?