Decades ago, Toronto radar would tell me that I had altitude or code errors. Several times I took the transponder, then the whole plane to the avionics shop at Toronto, and each time it was pronounced perfect. It turned out that the problem was entirely within the ground based system, but the controllers were not really honouring up on that. It was a rather expensive learning exercise for me, three times to the avionics shop.
So, I got it fixed, checked on the plane for accuracy, had the certification, and if ATC told me that there was an error, I told them there was not, and I had the certification to prove it. Never a problem after that - same txp, for 26 years since, not a blip....