The current implementation of Cursor::count does not allow to distinguish a 0 result from an error.
In our case, the query coincided with a chunk move. The return document contained "ok" : 0, and a string for "errmsg". run_command returns the errormsg string. This in turn causes count to return 0.