At least 50% of time on every software team I've ever been on was spent on maintenance and fixing bugs.
You can expense such time as opex, but it has to be justified, and that's often difficult to do. Did you fix a bug by refactoring some code to avoid the problem? Is that capex or opex? Can you convince the IRS of such?
The old (and now new) rules eliminated this accounting game and uncertainty.