Yes to all the things Curlz and Tazlima said. I have additional thoughts I want to share. These might be right or wrong, I don't know. It's how I perceive it from a reader's perspective.
Without reading the work in question, I'm going to venture that the reason has to do with what you said about current knowledge. So, basically, when you get down to it, first-person, past-tense narration is a character telling the reader the story after it has happened. So current vs. past knowledge will necessitate a tense change. Maybe. But it's not so much a grammar rule as it is a narrative choice, I'd say.
If I'm telling you at story about what happened to me at the grocery store, I might say, "I came to the dairy section, and it was packed full of carts. I couldn't get through, and I had to wait a long time for it to clear out. It was maddening because I don't even buy dairy. I'm lactose intolerant." The story about what happened in the past is in past tense, but I'm also providing information that's true, now, well after the events of the story, so I relate those in present tense.
Doing this sort of present tense narration is a bit of fourth wall breakage. Whenever the narrator switches to present tense, it reminds me I'm being told a story and pulls me out of the immediacy of the story (which I still feel in fast-paced past-tense narration). But it can be a narrative choice. I've seen lots of stories with conversational narrators who make frequent present-tense comments.
Joyland* by Stephen King said:
I had a car, but on most days in the fall of 1973 I walked to Joyland from Mrs. Shoplaw's Beachside Accommodations in the town of Heaven's Bay. It seemed like the right thing to do. The only thing, actually. By early September, Heaven Beach was almost completely deserted, which suited my mood. That fall was the most beautiful of my life. Even forty years later, I can say that. And I was never so unhappy, I can say that, too. People think first love is sweet, and never sweeter than when that first bond snaps. You've heard a thousand pop and country songs that prove the point; some fool got his heart broke. Yet that first broken heart is always the most painful, the slowest to mend, and leaves the most visible scar. What's so sweet about that?
*I had to type that out, so any typos are mine...
The story being told is in the past, but there's a lot of present tense in that excerpt where the narrator is addressing the reader in the present.
On the other hand, you don't have to go in for that style of narration. You can stick to mostly past tense with the very occasional present-tense narration when the character says something that is true in the narrator's "now" (present knowledge, states of being, universal truths, etc.). "When he put his hand on my thigh, I threw my drink in his face. I hate grabby strangers." Then again, in lots of those cases, you can also just keep it in past tense: "When he put his hand on my thigh, I threw my drink in his face. I hated grabby strangers."
Or you could write around it. In the example you gave, "I don't know how long we went that way..." it could easily be written to something like, "It was impossible to tell how long we'd walked...."
For me personally, when there's a lot of present-tense commentary, I feel like I'm reading something that is being told to me by a personable narrator who is aware they're telling a story to someone. When there isn't any present-tense commentary, I feel more like the narrator is invisible, like the story is being told with no real awareness of the reader. And those two types of interacting with the narrative have different effects on me.
So yes/no on the "...are these just grammar rules that authors are allowed to break for the sake of sounding better?" thing. They're not really breaking grammar rules... but you do kind of decide whether or not to use present tense in a past-tense story based on what narrative effect you're shooting for.