But its inerrant right? And if the author intended to write history it should be that way?
It really depends on what you meant by “writing history”. Our sense of history as an objective, scientific and “minimially biased” task of writing “just what happened” is really a modern, post-Enlightenment discipline.
Most ancient writers weren’t interested in that sort of historical writing (the closest is perhaps Thucydides), likely because they didn’t see the relevance. Ancient Jewish and Christians, especially, were primarily interested in theological histories that examined the relationship of man to God through shared narratives of particular events.
I find that from the 1850s-1950s there was an intensive period of historical skepticism against Christian claims to historical events (e.g. the resurrection, Noah’s ark, etc.): it was a very black and white reading of what history is, what writing history looked like in practice, how do we evaluate the historicity of claims, etc.
So there eventually rupted two diametrically opposed camps: (1) the “figuratists” - for lack of a better term - who disbelieved the historicity of any narrative and understood everything figuratively, “it’s a metaphor!”; and (2) the “literalists” - again, for lack of a better term - who believed that Christianity hinges upon finding pieces of gopherhood shaped in an ark on Mount Ararat lest the entirety of Christianity be disproved.
I find that contemporary discussions tend to be more nuanced: yes, we should test Christian claims against history (we exist in history after all), but we should be wary of making the evidentiary standards particular to the academic history discipline into the be all and end all of Christian faith.
The problem with the latter case is that you’re not so much theologically believing in Jesus as you are historically believing in the analyses of professional historians.