A lot of people do use Autofac, Moq, Autofixture etc... but this doesn't really meet the standards of being able create humanizer quality code without a lot of setup and teardown. Instead just have the ai do that for you, authorize the specific area the user has authroization for, and then only that data and those methods can be debugged. You keep iterating iteratively until you uncover the necessary breadth of the bug or feature, then you update the ticket to explain the correct scope, environment, set of classes and methods, get approval from like a lead or senior dev, then tackle the problem. Then once the work is complete then your senior dev can verify the code solution matches the expectation. Establed your earned value, actual value relationship and estimated values roughly match and complete the ticket.
The other prominent part of this, considering AI advancements, would be to create an air gap of AI LLMs to handle loading in data on prod, removing any personal info or PII, and then also activating the repository or context to perform the interface between developer and the environment back and forth data transfers and still solve the bug issue without compromising some compliance issue or security issue. I can tell you right now this is about 2 years away at least.