It’s a pain in the ass when the car gets old enough to require emission testing every year. I ran catless headers on my S4 for many years and although the car sounded great, every year I had to go through this ritual. My ECU was flashed to not throw codes, but failed readiness. For emissions I installed minicats, hooked my laptop up to my OBD port via a VAGCOM cable, cleared codes, then needed to drive around for about 20 miles and head into testing. It would only work from a cold start condition. There was a very narrow window and then readiness would fallback to failure. I would sit in the emissions testing line with my laptop hooked up checking readiness and at the last minute disconnect everything and stash it. It was somewhat nerve racking and after many years gave up and sold the car.
My point is every car is different and it took me many days and hours to stumble upon the method through trial and error.
The problem with changing out the OEM exhaust manifold or tubes in any way boils down to timing. There is timing between the upstream and downstream O2 sensors. Changing the path length of the exhaust flow confuses the sensors and throws codes.