Seems like a bold prediction that most (maybe any?) grocery stores have the level of corporate organization or even level of education to even consider a "secret order substitution to prole cart-pushers who will then have to answer customer service calls asking why their order was amended to add a more expensive item".
Someone down the line has to actually act out the 'evil algorithm', and will then have to actually interact with the aggrieved customers.
In a third party delivery service I imagine it would be trivially easy to get the line workers to betray the customer / rest of the organization, but there are also none of the incentives to, for example, try to dump low velocity items through deliberate substitution errors.
Maybe we have different experiences but you talk as if substitutions are not a regular part of the process - I'm not a massive delivery shopper but in the pre-Covid era it was almost unheard of to get a delivery without at least one item substituted when you forget to deselect substitution. I switch amongst three of the major chains and the experience is basically the same.
Also I don't think your approach need be how it's enacted. You could quite easily run a set of adjustments against the restocking priories to see which had the least negative effect on profits and that would likely result in this kind of substitution the way it's observed. This wouldn't even need one to put on a "let's do evil hat", couched in these terms it comes across as perfectly reasonable.
Substitutions are omnipresent in my experience, but I view that as a symptom of almost all stores having really profoundly bad inventory tracking (do the developers for the web platform even know whether they have any items on the shelf at all?) so even with ordinary infrastructure hiccups I'd expect there to never be completely filled orders.
I don't know too much about the way the restocking priorities are established, but it appears to be totally ad hoc and at the behest of the shift worker on the line at the moment your order us started from what I've seen.
The stores would need to have inventory systems fine grained enough to know that there are high margin items in stock to be swapped in to implement this kind of malicious action plan, but I think most stores (that aren't Walmart) don't even have their inventory spatially mapped at all, let alone multiple times per day to actively dump target items.
Someone down the line has to actually act out the 'evil algorithm', and will then have to actually interact with the aggrieved customers. In a third party delivery service I imagine it would be trivially easy to get the line workers to betray the customer / rest of the organization, but there are also none of the incentives to, for example, try to dump low velocity items through deliberate substitution errors.