“Non-fiction” just means that the author is not marketing it as fiction. It does not mean that what is in there is true.
Scholars write to publish their hypotheses, which may turn out to be correct… or not. Encyclopedias, text books etc. that were accurate at the time become outdated as science marches on. Ancient historicians and naturalists usually included about every bit of yarn and legend they heard. Hell, even in contemporary writing, there are plenty of books on magic, pseudoscience, sensationalist biographies etc that are less grounded in reality and have less educational value than plenty of fiction books (not even just things like Hard SF or historical novels, but also, say, an Urban Fantasy author who took care to work in the atmosphere, history and legends of the place the story is set in), yet still technically count as non-Fiction, because the author said so - whether because they actually believe it to be true, because they are simply scam-artists or because they just don’t care if their claims are true, just the attention.
And I am with Swede: “Fiction” and “Non-Fiction” are so absurdly impractically broad categories (hell, “Fiction” is even more so than non-Fiction!) that I doubt any library would use such a system. If anything, I would put the Bible into a third category besides “Fiction” and “Non-Fiction”, for books preserved not for information or entertainment, but rather for historical value, along with things like the Gilgamesh Epos, Plato’s dialogues, the Communist Manifesto and the Systema Naturae.
What is On the Origin of Species categorised as?