I wonder if it was percentage based. That'd be one of the easiest mistakes to make.
- Player has a stat of 100
- Wears "+10%" helm
- Player has a stat of 110
- Removes helm, game subtracts 10%
- Player has a stat of 99
Actually, now that I think about it more, that wouldn't work as described above because once your stat got close to zero you'd enter a kind of Zeno's Paradox situation.
it's more likely that the stat for equipping is calculated differently to when unequipping (ala, "same" code in two different places, and one got modified at some point and forgot about the other).