I suggest looking for a corroded or loose ground connection.
Don’t know if this is your issue - but it certainly sounds all too familiar even considering it was on an A-4 and not a Q-7. What seems so familiar is the intermittent loss of power, various different indicated failures.
My experience with this issue was frustrating, somewhat expensive and time consuming to resolve - but in the end it was a simple and inexpensive final fix. Hopefully yours is resolved quickly.
We fought a similar issue with a 2007 A-4. For multiple years we had intermittent issues where the car lost power for no apparent reason. It would still run and we could still drive it - but it was less than a limp mode - or so it seemed.
Sometimes shutting the car down, waiting a few minutes and restarting it would seem to solve the issue. Diagnosis came back with a variety of issues - each instance indicated a different cause when the computer decided to drop a code
- although the same symptoms.
The technicians spent MANY hours on the phone with Audi’s tech support - but it never really helped very much.
We ended up replacing multiple sensors, valves etc. with the most significant replacement being an entire wiring harness. Each repair would seem to resolve the issue - at first - but it would then reoccur. Ultimately we found the true root cause - a corroded ground connection to the chassis. It was in an obscure connection - but we finally found the corroded connection. Cleaned and reset the connection - issue resolved - no issues since.