Not getting any error, the above query returns top 250 orders and after that it does not return the next 250 orders.
Yes there are thousands of orders in store. I also tried to check this variable “ShopifyAPI::Order.next_page?” and it returns false but there are many orders below top 250 orders.
The script which is mentioned above should return all orders in one execution, but unfortunately it is not happening for me.