Aggregation contains old values

Can someone please help on the below request?

Please find the below example and the exact issue I am facing....

I'm having some problems with aggregations returning old data. When I query directly using bool/must/term the data is not there - as it should. Only in aggregation results.

  1. I have a property called foo.
  2. Then I updated all the documents where foo had the value from x to y.

Querying directly for foo = x yields 0 results (Old value) and foo = y yields 10 results (New value)

When aggregating foo I receive x in the foo property (with doc_count=0) and y in the foo property (with doc_count=10, which seems correct) . why still x is appearing in foo property with zero doc count?

Elasticsearch version 8.15 running in Elastic Cloud.

Note: when I removed the index completely and populated the index again, everything was working as it should. It only appears to be happening on existing indices.

As per documentation this is possible, in particular:

Setting min_doc_count=0 will also return buckets for terms that didn’t match
any hit. However, some of the returned terms which have a document count 
of zero might only belong to deleted documents or documents from other
types, so there is no warranty that a match_all query would find a positive 
document count for those terms.