text: Title: [APM] Improve API test to avoid rate-agg-like regressions in the future
  Body: In https://github.com/elastic/kibana/pull/112343 we removed rate aggs because they have a bug in ES. 
  We only noticed the bug a few days before the release even though the bug has been in place for months (since metric-based ui was enabled).
  
  We should investigate how we can catch problems like this in the future