When applying filters to some text, the result can contain HTML, e.g. if the text has MathJax. If this filtered text is returned in a WebService using PARAM_TEXT, this throws an 'Invalid response' error.
The last case I detected is in core_files_get_files. When retrieving "Site files" (contextid=0 and itemid=0), you receive 1 folder per category, and then in each category you get 1 folder per course. Course names are filtered, so if you have a course with MathJax you end up with the 'Invalid response' error.
This can be reproduced with the mobile app, open the user menu at the top-right, go to Files, select 'Site files' and then open a category with a course containing MathJax in its name.
In this case, since this is supposed to be a file name, maybe the best solution is to filter the text and then remove the HTML of the result.
We've found this same error in other WebServices, we should try to find other WebServices that could be affected by this.