Error when uploading unit test tesults using harbormaster.sendmessage API

In general our integration for building review requests work quite well.
But now I had the case that one build was hanging (build stays blue) in phabricator.
The reason for this was, that uploading a “fail” result didn’t work because of some unit test results.

I changed the script to upload the results individually using the “work” state to see what result causes the error. As expected it was the only test case that didn’t pass and contained errors. But anyway it simplifies the anlysis.

Here is the message I can use to reproduce the error:

Request(debug): {
   "unit" : [
      {
         "name" : "test_uaapplication",
         "duration" : 9260,
         "details" : "********* Start testing of uaapplication/gds *********\nFAIL!  : test_gds_csr() Compared values are not the same.\n   Actual   ((int)ua_bytestring_length(&grl_cb_data->crts[0])): 1362 (0x00000552)\n   Expected ((int)cert1024_der_len): 589 (0x0000024d)\n   Loc: [/var/www/ci/src/src/test/uaapplication/uaapplication.c(375)]\nTest finished: 1 tests of 1 were run.\n  0 PASSED.\n  1 FAILED.\n  0 SKIPPED.\n********* Finished testing of uaapplication/gds *********\n",
         "result" : "fail"
      }
   ],
   "type" : "work",
   "__conduit__" : {
      "token" : "api-secret-hidden"
   },
   "buildTargetPHID" : "PHID-HMBT-j7eelzqk4mpgbvb7q2nt"
}

Response: {
   "result" : null,
   "error_info" : "Invalid parameter information was passed to method 'harbormaster.sendmessage'.",
   "error_code" : "ERR-CONDUIT-CORE"
}

The Request/Response statements are not part of the message, just for the debug output.

Obviously it has todo with the unit.details part, because this is the only difference to other results that work withou issues. I suspect "result" : "fail" is correct.
It string looks like valid JSON to me.
Are there any constraints like invalid characters ot make string length I don’t know about.
The error message alone is not very helpful, unfortunately.

version info:

| phabricator | 502ca4767e4b4ce5d06d83e2889c3696e2df22ef (Nov 8 2019)  |
| arcanist    | cc1ff38843c47ef1516b9bdc3fa2ae00b2e53a38 (Oct 29 2019) |
| phutil      | 39ed96cd818aae761ec92613a9ba0800824d0ab0 (Sep 30 2019) |
| php         | 7.3.14-1~deb10u1                                       |
| diff        | 3.7 at /bin/diff                                       |
| git         | 2.20.1 at /bin/git                                     |
| hg          | Not Available                                          |
| pygmentize  | 2.3.1 at /bin/pygmentize                               |
| svn         | Not Available                                          |