Although it's not enforced that fail_json['msg'] should be a string [1], I think it is pretty strongly implied. In this case the failure_response['msg'] is sent through as the fail_json['msg'], and the trailing commas here turn it into a tuple. It's not clear if this is a typo or intended, but it does cause problems for callbacks that expect this as a string (e.g. [2]). Since there seems no point to having these values as a tuple, remove the trailing commas so they return a string as per everywhere else. [1]4c589661c2/lib/ansible/module_utils/basic.py (L2078)[2] https://review.opendev.org/#/c/696081 (cherry picked from commitfc54ae9227)