I see this used wrongly so often now I'm losing any sense of what's correct. Often it's clear from the context that the person writing has got it the wrong way round - I think. This is similar to many posts I've seen on MN in the last few days.
Ordered a tub of cranberry sauce for Christmas dinner - it was substituted for a jar of mustard.
Surely that should be 'substituted with'? TBH, to avoid this problem, I now mostly write 'replaced by' or 'replaced with'.
Got that out of my system now!