悪性だった場合 implies "after doing something then you find 悪性”
悪性の場合、does not imply such beforehand action.
Let me explain with broken Chinese.
***良性の場合、悪性の場合。
-> "良性/悪性" 的 "場合”
例:「良性の場合は、手術は必要ありません。しかし悪性の場合は...」
***良性だった場合、悪性だった場合。
「た」implies "completion", "fixed", like Chinease ”了"
例:この腫瘍が良性か、悪性か、それは開腹しないことにはわかりません。
実際に目視して、もし悪性だった場合は…、最悪の事態も想定する必要があります。
in the sentene above , it is better to say もし悪性だった場合は than ”もし悪性の場合は”
because it describes, "開腹、目視、then finally you have found it is 悪性"