The formula for geniuses appearing mad is: They are aware of more things than most people, and when combined with their often increased sensitivity can then be more affected by things as they are relatively overwhelmed with information.
Then, because their understanding of many things that would pass over other people is very hard to explain to others, it may be assumed by some that, just because they don't make sense to them they must be mad.
But the madness is genius theory can't work, as a genius can usually understand another one, but a genius (or anyone else) will ever understand a mad person as they are not relating to the shared reality or logic but one of their own.