English
(A) 彼は医者だと言ったが実際はそうでなかった。
(B) 彼は医者だと言ったが実際はそうではなかった。
Jumping to conclusions, the understanding of the questioner who thought that sentence (A) should end with "ではなかった" like (B) instead of "でなかった" is almost correct.
According to the research shown in kimi Tanaka's answer, the part of "でなかった" in sentence (A) corresponds to an example of use as "predicative form" in "a main clause". In this case, "ではなかった" was overwhelmingly used compared to "でなかった" at the frequency of 217 : 18.
Then why in ウィズダム英和・和英辞書, do they describe the ending form as (A) instead of (B)?
I think there are two possible reasons as follows.
1. Though "そうでない" is not used frequently, it is correct as a Japanese usage. Moreover, (A) makes sense and I can understand it very well.
2. When you look closely at the sentence of (A), the pronunciation of "は{wa}" in "実際は" is used before "でなかった". Therefore, the use of "は{wa}" in "ではなかった was avoided, either intentionally or naturally.
However, for the second reason, a new problem will arise if you don't think the reason well. What will happen if a higher priority is given to "は" in "ではなかった" over to "は" in "実際は" and the former "は" is actually omitted? Then you'll get a sentence shown in (C).
(C) 彼は医者だと言ったが実際そうではなかった。
(D) 彼は医者でないと言ったが実際そうではなかった。
Although (C) seems to be a sentence having the same meaning as (A) at first look, you'll soon realize that (C) is logically incorrect as Japanese comparing it with (D).
(D) is grammatically and logically correct Japanese, meaning "彼は医者でないと言ったが、そのとおり医者ではなかった He said he was not a doctor, and he was not a doctor as was said," while (C) is grammatically correct Japanese, meaning "彼は医者だと言ったが、そのとおり医者ではなかった He said he was a doctor, and he was not a doctor as was said", but it is logically incorrect.
As for why this kind of thing happened, "は" in "実際は" cannot be omitted. In other words "実際は" and "実際" have different meanings. "実際は" means "in fact, actually or to tell you the truth" and "実際" means "as is said" and they cannot be interchangeable with each other.
In conclusion, the questioner has a doubt about the usage of "でなかった" in (A), but it makes sense as Japanese, and there is no particular problem in it. Needless to say, (B) is also perfectly correct Japanese with a similar meaning, but since "は" continues, I feel a bit frustrating to say it myself. However, this feeling seems to change depending on a person, I think that some people say that they like (B) better.
日本語
(A) 彼は医者だと言ったが実際はそうでなかった。
(B) 彼は医者だと言ったが実際はそうではなかった。
文章 (A) における「でなかった」の箇所は「主節」における「終止形」としての使用例に相当し、kimi Tanakaさんの答えで示された研究文献によると、この使用例では217:18の頻度で「ではなかった」が圧倒的に多い。
従って、質問者が疑問を持ったのはもっともなことである。
それでは何故、ウィズダム英和・和英辞書で (B)ではなく、(A) のように「でなかった」となっているのであろうか。
その理由として次の2つが考えられる。
1. 使用例としては少ないが「でなかった」も日本語として間違いではない。また、意味も良く分かる。
2. 「でなかった」の前に「実際は」という同じ発音の「は」が使われており、それに続く「ではなかった」の「は」の使用が、意図的にか自然にかは別にして、避けられた。
しかし、2 の理由の場合、良く考えないと問題が生じる。もし、「ではなかった」の「は」を優先して、「実際は」の「は」を省略するとどうなるか。文としては (C) に示したようになる。
(C) 彼は医者だと言ったが実際そうではなかった。
(D) 彼は医者でないと言ったが実際そうではなかった。
一見 (C) でも問題なく (A) と同じ意味の文と思われるが、(D) と見比べると良くわかるが、(C) は日本語として論理的におかしいことに気づく。(D) は正しい日本語であって、「彼は医者でないと言ったが、そのとおり医者ではなかった」という意味だが、(C) は「彼は医者だと言ったが、そのとおり医者ではなかった」という意味になり論理的におかしい。
何故このようなことになったかというと、「実際は」の「は」は省略できないのである。言い換えると「実際は」と「実際」とは意味が異なるのである。
「実際は」は「実際のところは in fact, actually or to tell you the truth」と言う意味であり、「実際」は「そのとおり as is said」と言う意味であるので置き換えできないのである。
結論として、質問者は (A) の「でなかった」の使用法に疑問を持っているが、日本語として意味が通っており、特に問題はない。むろん (B) も同様の意味を持った正しい日本語であるが、「は」が連続するので私にはややくどく感じる。但し、この感じは人によって変わると思われ、(B) の方が好きと言う人もいると思う。