The Scrum framework certainly addresses capacity planning and scheduling, although it's not prescriptive about how the Scrum Team should manage the issues you describe. The implementation details are left as emergent properties of the framework's inspection and adaptation cycles.
From a purely practical perspective, you need to reduce your planned capacity to reflect the amount of work the Scrum Team is currently able to do each Sprint. The team should then continuously adapt its processes to reduce production problems and avoid work unrelated to its Sprint Goals.
Analysis and Recommendations
Scrum Theory says (emphasis mine):
Scrum is founded on empiricism and lean thinking. Empiricism asserts that knowledge comes from experience and making decisions based on what is observed....Scrum employs an iterative, incremental approach to optimize predictability and to control risk.
What this means is that Scrum optimizes for predictability rather than high rates of utilization or throughput. Scrum doesn't increase your team's capacity to do work; it simply provides a framework for creating a predictable development/delivery cadence based on empirical evidence of how much work the team can get done within a typical iteration.
The Scrum Team is expected to inspect-and-adapt. This can take many forms, including:
- Improving tools and processes to avoid deploying bugs to production.
- Reducing planned capacity for each Sprint until you can predictably deliver your Sprint Goals most of the time.
- Managing interruptions and change requests by educating other parts of the organization on the cadence of framework events such as Backlog Refinement, Sprint Planning, and Sprint Reviews.
- Deferring less-urgent issues to the Product Backlog, where the Product Owner can influence when the issues will come into scope in a future Sprint.
When process problems are outside the direct control of the Scrum Team, the Scrum Values still require that:
The Scrum Team and its stakeholders are open about the work and the challenges...The Scrum Team members have the courage to do the right thing, to work on tough problems.
Pragmatically, this includes making issues with code quality, tooling, infrastructure, or organizational issues visible and transparent to all the stakeholders. Senior management ultimately drives company culture and budget, so they have ownership of all problems that can't be resolved by an empowered and self-managing team.