You cannot have a sub-aggregations under a top metrics aggregation. It is a bug that you don't get an error in this case, i have opened: top_hits aggregation should fail if it contains sub aggregations · Issue #95663 · elastic/elasticsearch · GitHub
1 Like