Homer makes THE BEST literary comparison to the Pentateuch (first five books of the Bible), period, hands down, game over, what's for lunch. Neither the Iliad nor the Odyssey nor the Pentateuch was considered fiction when it was written. People believed that Adam, Eve, Abraham, Achilles, Jehovah and Zeus were real. In the case of Harry Potter right from the start everyone understood that Harry was a fictional character, and that J K Rowling didn't really believe in witches. (Which is only one of the reasons why the claim that 2000 years from now people will believe that Harry was real, a claim often made by these New Atheist idiots comparing Harry Potter to the Bible, is so teeth-grindingly, head-spinningly stupid. It would require a catastrophic decline in our civilization, a huge breakdown, a Mad Max-type situation, in order for people to believe Harry was real. [4 years of President Ted Cruz might do it.] Fiction was written 2000 years ago. Everybody today knows that nobody 2000 years ago thought that Plautus' plays or Petronius' novel Satyricon [Yes, I said novel. There were novels before Tom Jones and before Don Quixote and before Gargantua and of Pantagruel, and yes I mean novels written in prose and everything.] were meant to be taken as non-fictional depictions of anything.) Also, the Exodus, if it happened (if so it was much smaller than described in the Bible) happened right around the same time as the Trojan War, if that war happened, and of course if it happened the Greek deities didn't participate, because they're not any more real than Jehovah or Satan. The time period of the Exodus is the same as that of the Trojan War, somewhere between 1400 and 1200 BC, a time of general chaos throughout the Middle East, when some civilizations vanished and some others arose, a time from which relatively few records survive. With both Homer and the Pentateuch, we don't know who originally wrote them (there's a legendary author in each case, Homer and Moses), or when they first began to be written down. Both were in something resembling their current written form by the 6th century BC. Both laid the cornerstone for a whole society, Greece in the one case and the Hebrews in the other. The resemblances are just remarkable.
Of course, that's only the first five books of the Bible.