Are you saying you have the automation set to order products at the quality of 100, but sometimes it orders at higher qualities?
With the default settings, you don't order new product until you have less than 1 month's supply left, then you order 10 months of product. What can happen is that if the product is in short supply, you won't get the order filled in the first month, and the system will shift the order to an immediate order. At that point, you'll take what quality you can get and at any price at which anyone's willing to sell.
I modified my default ordering strategies (Trade -> Order Strategies) to order at 3 months instead of 1 month. It means I have some supplies sitting around longer, but i usually get the quality and price I want to pay.