Wire it to the price
The middle row now identifies the wine. To turn that identity into a price, connect each middle unit to the price through one weight.
The plummy cabernet unit reports 1; the other three report 0. The active weight begins at 25, so the calculation is:
1 x 25 + 0 x 25 + 0 x 25 + 0 x 25 = 25
The guess is 25 dollars. The real price is 40.
At the start, every weight is 25, so the machine guesses 25 dollars for every wine.
The plummy cabernet and apricotty viognier cost 40 dollars. Their guesses are 15 dollars too low. The apricotty cabernet and plummy viognier cost 10 dollars. Their guesses are 15 dollars too high.
The total error adds those four misses together:
15 + 15 + 15 + 15 = 60
For every guess to be right, each weight must match the price of its wine: 40 for plummy cabernet, 10 for apricotty cabernet, 10 for plummy viognier, and 40 for apricotty viognier.