This error "The response is not in a JSON format." usually means that the prior activity was misconfigured or the expected input was not properly formatted. The query activity output may not be compatible with the comment action without modification.
Options:
-Change the query to output less data or change the output
-Parse the body (output) using a JSON parser activity
-Look for examples for how other playbooks reuse query output (maybe formatting as an HTML table for example).