The method WP_CLI::error_to_string() is supposed to accept an error object and return an error message that can be output.
However, if you pass a type into the method that it doesn't recognize, it doesn't return anything at all.
This should never happen. If it does nevertheless, it should throw an InvalidArgumentException to make sure a developer sees this and fix the problem.
The exception could use a message like the following:
Unsupported argument type passed to WP_CLI::error_to_string(): {$type}