if I'm not mistaken, そう is 然う (an adverb) but I don't see any rules about adverbs when I look up the rules for the grammar pattern のだ. they only say that な should be added to na-adjectives/nouns, nothing is said about adverbs at all.
Am I wrong about the noun/adjective distinction? About the grammar of そうなんだ? A possible omission of a noun?