Correctly handle failing query in sharded agg