It's strange that they rarely worked together. They first met when Dick Van Dyke was miming Andy Griffith's football record. He was the murderer on the first regular Matlock episode. (Clips appeared in a later episode.) Andy Griffith worked several times with Dick's brother Jerry. There was an episode of TAGS, the movie Angel in My Pocket, and a nightclub act.
Yes, I agree here that they either should not have cast Dick Van Dyke in this role, or had someone else play the judge and murderer in the Matlock episode "The Judge". This is what I refer to as "the Twin Cousin" routine. We can easily look at Dick Van Dyke playing this role and think that Dr. Sloan and Carter Addison (his role in Matlock) were twin cousins. We can also safely say either that their mothers were sisters or one's father was the brother of the other one's mother, which would account for the different last names.