I did notice this heuristic broke in my unit tests when maxNumCells was "1" so I think a better heuristic needs to take number of shards into account too.
Feels like it should be centralised somewhere as a common function because I've seen the bad counting raised as a bug before on terms facets