The script is correctly returning the datasets, as can be seen in the image, however, in the CUSTOM SESSION, "Invalid Key" appears in all returned datasets.
Well, no, we can't see. You haven't shown any data.
That means you are generating an object for Perspective that has keys that are not valid JSON identifiers (have spaces or punctuation, or start with a digit). That is common when blindly converting datasets to JSON format, as datasets allow pretty much anything as column names (matching SQL standards). JSON is more strict.