I don't think it is?
I had to look up what specifically Sagan's errors about history were and yes it looks like he popularized a lot of bad mythology (I referenced this site[0]). I have to admit I believed a lot of this myself at one time. But I think there's a difference between the plausible but wrong and the impossible. If he'd said he thought Atlantis was real, or gone on about Tartaria or the great Ice Wall, that would be a lot closer to magical thinking.
Although it is a lot easier to be led astray by plausible lies than implausible ones. It seems like Sagan is certainly guilty of not being critical about narratives that reinforced his worldview.
[0]https://talesoftimesforgotten.com/2020/02/05/carl-sagan-was-...