Not only that, Sweet Synthesis depends on accurate Mall Prices for candies.
The Synthesis Frame lets you "check" prices - and I encourage you to do that - but scripts don't have that ability.
My script did this:
Isn't that special. It bought 24 candies for a WAY higher price than expected because the registered mall price was out of date.
buy 10 Now and Earlier for 17111 each from shop #341946 on 20200912
buy 3 Now and Earlier for 18000 each from shop #1588794 on 20200912
buy 11 Now and Earlier for 19600 each from shop #102069 on 20200912
cast 1 Sweet Synthesis
Encounter: Sweet Synthesis
synthesize 12 Now and Earlier, Now and Earlier
You acquire an effect: Synthesis: Greed (360)
Had I been synthesizing one at a time, the price calculation would have auto-corrected after the first purchase.
Or if there is a way to tell KoLmafia to "update prices", just as is done in the GUI, it would have spent about 30,000 less Meat per synthesis, buying cheap sugar sheets instead.