Disclaimer: I don’t work on the team that handles this but have some experience with similar issues. In short, the description for the error is:
The given aggregation cannot be performed with the requested accuracy. Try allowing approximate results or adjust your aggregation request.
The longer answer is computation for aggregations can get spread across multiple servers. If you sum a bunch of numbers on each server and then ask to order the sums, doing the work on each server and then combining those results is not guaranteed to be the same as doing all the work in one place. The elasticsearch docs have the full details of what is happening behind the scenes: https://www.elastic.co/guide/en/elasticsearch/reference/8.5/search-aggregations-metrics-cardinality-aggregation.html#_counts_are_approximate
So if you want to stop the error you can swap the exact accuracy requirement to approximate, decrease the number of buckets, or order outside the aggregation query itself. Hopefully this is helpful!