Yes it is possible a bad gasket could throw the P0410 code, but I doubt a "mechanic" would reuse a gasket that wouldn't do the job. He should have also been certain the air passages were clean as well as the used "new" switch over valves were clean and working. I hope you are taking your car to a independent shop that deals specifically with European cars. They will also have the correct scan tool to figure this out.
Does your car have a tune or is the PTCM, commonly called the ECU, programmed as original?
Here is a link to diagnose P0410 , part 1 explains the system and part 2 near the end of the video shows the O2 sensor test with a bidirectional scan tool
part 2 follows part 1 at the site. Hopefully your mechanic has that ability. Good Luck!
PS here is a video on a Mercedes very similiar to our car and showing exactly what I'm talking about with the switch over valves :