While the literal sense of scripture always points to real events, it must be read in the context of the style that was prevalent at the time of writing. As with much of Genesis, this style is that of founding mythology, how the world came to be, and how the people of Abraham, the people of Israel, found themselves in the place where God had planted them.
So when the author says ‘the whole earth’, he is not speaking as a contemporary climate scientist who can see the entire planet. There is evidence that there was flood and tectonic activity in the Ancient Middle East, which may have destroyed entire cities and countries, so it is quite believable that the entire ‘world’ that Noah and his people had known was destroyed in a flood. Imagine if a tribe of pre-Colombian Native Americans had seen the entire area between the Great Lakes flooded, the only place they had ever lived. Would they not write that the flood covered ‘the whole earth’.
If we understand the story in that way, then ‘every creature’ may likewise refer to those creatures that were part of the social ‘world’ of a settled, herding society - the animals they ate, dogs for herding, cats for keeping vermin away from crops, and we know that birds were involved. There’s no reason to believe that Noah had 2 dung beetles and 2 bengal tigers onboard the ark.