Is it bad karma if you say something that turns out to be false? In DN 27, the Buddha said that the Brahmins make bad karma for speaking falsely.

“Actually, Vāseṭṭha, the brahmins are forgetting their tradition when they say this to you. For brahmin women are seen menstruating, being pregnant, giving birth, and breast-feeding. Yet even though they’re born from a brahmin womb they say: Only brahmins are the first caste; other castes are inferior. Only brahmins are the light caste; other castes are dark. Only brahmins are purified, not others. Only brahmins are Brahmā’s rightful sons, born of his mouth, born of Brahmā, created by Brahmā, heirs of Brahmā.’ They misrepresent the brahmins, speak falsely, and make much bad karma.

So my question is do you get bad karma if you say something you thought was true but turned out to be false?
No. When it comes to lying, bad karma is not related to the actual truthfulness of what was said.
Rather, it comes from intention. Speaking the untruth intentionally is bad karma and a violation of one of the five precepts. Please see this answer for more details.
From Nibbedhika Sutta:

Intention, I tell you, is kamma. Intending, one does kamma by way of
body, speech, &amp; intellect.

From Iti 25:

This was said by the Blessed One, said by the Arahant, so I have
heard: &quot;For the person who transgresses in one thing, I tell you,
there is no evil deed that is not to be done. Which one thing? This:
telling a deliberate lie.&quot;