Hello !
Thank you for posting on Microsoft Learn Q&A.
With search=* every document gets the same relevance score (1.0). If many rows share the same MaxUnits value, the service is free to break ties in any order.
Search Explorer and your REST call can therefore return different documents at the top even with the same query.
Make the ordering deterministic by adding a unique tiebreaker and replace ID with your actual key field :
GET /indexes/{indexName}/docs?
api-version=2024-07-01&
search=* &
$orderby=MaxUnits desc, ID asc &
$select=* &
$top=5