I created the following script which produces a string I later use in a JSON response. However, it throws an error despite it being formatted correctly. What is strange is i