I had it in a DA40 and it turned out to be bent pins connecting the loom to one of the boxes that you mention.
I'm sorry that I can't remember which, but ask the avionics chaps to check the loom for chafing and to check all the pins.
It was an intermittent problem and often impossible to reproduce on the ground. I took a picture of it at FL100 with a thumbs down...