will a record set derived from jsonb_to_recordset always maintain the order of the items in a JSON array
Here's another solution using another of Postgres' json functions: jsonb_array_elements.

  SELECT id, (value-&gt;&gt;'benefit')::varchar as benefit, ordinality as rank
  FROM products 
  CROSS JOIN LATERAL jsonb_array_elements(benefits) with ordinality


"with ordinality" gives you the order of each array item and allows you to do an explicit order by on that field to ensure the order remains the same.

This stackoverflow post was very helpful