Those costs are built-in from the outset.
You pay NOTHING extra for firmware updates, after having bought the camera!
When was the last time you were charged an additional fee to download/install a firmware update?
The firmware / testing engineers total costs are built into the company's overall finances and head count. A new product will have projected R&D costs but the people will be allocated to projects as needed.
That said, there are detailed tacit knowledge in each product that only some engineers have so that they tend to be tethered to certain products or replacement product R&D until end-of-support dates. There would be engineers for the R5/R5ii family for this reason for fixing "phenomenon".
Each firmware build besides bug fixes would have costs for internal design/code writing/testing plus a bit of marketing. That incremental cost is not offset by new revenue. There could be a marketing budget where these costs are borne in lieu of new product implementation but that can be a bit advanced for older companies. The costs are probably absorbed in the R&D overall budget with management just approving the budget/cost difference on a strategic basis.
It is possible that the new fiware features were already being written for the R5ii and were "easily" ported to the current model although the cost would be included in the R5ii introduction.
All this assumes a reasonable length product lifecycle eg the ~4 years that Canon has done in the past. Shortening lifecycles changes SW engineering costs towards an "Agile" basis. The Agile SW development manifesto came out >20 years ago and it build on Rapid Application Development and Scrum methodologies from years before that. It sounds like nirvana but getting it right is really hard.
The Manifesto for Agile Software Development is based on twelve principles:
Customer satisfaction by early and continuous delivery of valuable software.
Welcome changing requirements, even in late development.
Deliver working software frequently (weeks rather than months).
Close, daily cooperation between business people and developers.
Projects are built around motivated individuals, who should be trusted.
Face-to-face conversation is the best form of communication (co-location).
Working software is the primary measure of progress.
Sustainable development, able to maintain a constant pace.
Continuous attention to technical excellence and good design.
Simplicity—the art of maximizing the amount of work not done—is essential.
Best architectures, requirements, and designs emerge from self-organizing teams.
Regularly, the team reflects on how to become more effective, and adjusts accordingly.