Hello,
I once struggled with a similar problem on my Passat:
https://community.dieselschrauber.org/en/viewtopic.php?t=15362&highlight=t%FCrsteuerger%E4t
A6 models and Passats from these production years should be at least similar, but my experience is based solely on the Passat. Nevertheless, the following steps are likely applicable:
* B-pillar connector - clean the contacts, check the cables for possible breaks (have you already done this?).
* Inspect the connectors at the door control unit.
* Door lock: disassemble and check the microswitches, inspect solder joints and circuit traces, measure the switch, measure the connection pins (you've already done some of this).
* Locate and expose the comfort control unit and check the connectors (this is located under the driver's seat in the Passat and is often damaged in cases of water ingress).
"If everything remains normal (i.e., no issues are found), the TSG (presumably a device) may be temporarily connected to the other door to see if the problem lies more in the control units or in the cable/connector pathway between them."
A diagnostic tool would likely be helpful to actually see the switch position as recognized by the control unit.
Unfortunately, I can't provide you with a wiring diagram for the A6.
Bye.
peace