「学校に行かなかったのは、重い風邪を引いたからです」- OK
「学校に行かなかったわけは、重い風邪を引いたからです」- OK
Both of them mean the same: 'The reason why I didn't go to school is I caught a bad cold'.
「わけ」means a 'reason'. 「からだ」means 'because'. So that 「わけ」should be used in the first unit of a sentence:「学校に行かなかった」