The man I thought was the criminal had nothing to do with the case.

Literal

Criminal [copula-だ-quotative-と] thought-[progressive-ていた] man [topic-は] case [with-とは] anything [genitive-の] relationship [also-も] exist-not.

Detective-story sentence. The long relative clause 犯人だと思っていた ('(that I) was thinking was the criminal') modifies 男. 何の~も~ない is a 'no X at all' pattern: 何の関係もなかった = 'had no relationship at all.' Inside, とは ('with X') + も combined with the negative gives 'not the slightest with X.' Classic twist reveal.