In the case of a failure, ShardsResponse contains a failures field, which is a list explaining what errors happened in each shard. This field is used by Kibana, but it's not listed in the SearchResponse type.
The definition most probably needs to be copied from https://github.com/elastic/kibana/blob/master/src/plugins/data/public/ui/shard_failure_modal/shard_failure_types.ts#L31