We had a really odd problem once. I thought the DI was packing up as it would "drift" 45 degrees on N-S headings. Actually it wasn't the DI at all but the compass, and if you were flying N-S and set the DI then turned E-W you'd be off by 45 degrees.
We only figured this out by cross referencing to the GPS ground track. When setting GT on the DI it was fine!
So we borrowed an external calibrated compass from our maintenance place and swung the aeroplane which indeed showed that the compass was out in the N-S headings. We adjusted the N-S heading adjustment screw to correct and it was right as rain ever since.