Smart collection "Best selling" sort renders wrong order in Liquid

Short description of issue

Liquid renders Smart collections sorted by “Best selling” in a different order than the Shopify Admin and the Storefront API.

Reproduction steps

  1. Create a Smart collection with several products.
  2. Set Sort: Best selling on the collection in Admin.
  3. Note the product order shown in Admin.
  4. Open the collection in Theme Editor or in the store directly, both with default sorting.
  5. Compare the order rendered by Liquid against the Admin order and against the order returned by the Storefront API.

Expected: all three surfaces return products in the same order.
Actual: Liquid renders a different order than Admin / Storefront API.

Additional info

  • Reproduced on multiple stores and multiple themes, including the stock Dawn and Horizon themes, so it doesn’t look theme-specific.
  • Storefront API returns the same order as Admin, so the discrepancy is specifically on the Liquid side.

What type of topic is this

Bug report

Upload screenshot(s) of issue