What you describe reminds me of the notion and outcome of “offsetting penalties” in sports, where a team fails to benefit from a mistake (penalty) made (committed) by its opponent because of its own mistake/penalty.
(example of usage from ‘The Handy Hockey Answer Book’ by Stan Fischler, via Google Books, where in hockey, except during the era of Wayne Gretzky, offsetting penalties result in both teams losing a player to the penalty box).
In your examples, especially the second one, you could consider using the notion of the verb “offset” (from M-W) as follows:
“… increases in productivity were offset by …”
(from ‘Productivity and Economic Incentives’ by J. P. Davidson, via Google Books).
The spendthrift and manager offset the
of their respective good fortunes by [making questionable decisions].
(example used with "the benefit" from 'The Benefit/Risk Ratio: A Handbook for the Rational Use of Potentially ...' by Hans C. Korting, M. Schafer-Korting, via Google Books)
Or for noun phrases (similar to offsetting penalties) to describe the phenomenon:
Offsetting events (example from ‘Including the Poor: Proceedings of a Symposium …’ via Google Books); or
Offsetting occurrences (example from ‘The Property Tax, Land Use, and Land Use Regulation’ via Google Books)
Their benefits were neutralized by offsetting events/offsetting occurrences.