There's absolutely no proof or official support to my theory, but the way I like to think of it is that sometimes the reporter gets it wrong. Like, imagine the play-by-play is being transcribed by a human being, and sometimes they forget things, or get things off slightly.
For instance: you know the common scenario where a steal happens after the 24 second clock has expired? (sometimes up to 35-40 seconds) Well, purely from my own personal observation and anecdotal evidence, I've never seen that situation occur when the two consecutive plays combine for more than 48 seconds. So, the way I rationalise it in my head is that the steal occurred earlier in the shot clock than reported, the reporter forgot to make note of this at the exact time that it happened, and corrected themselves by the next play. So as an example, instead of play 1 being 33 seconds, then a steal, then a score after 7 seconds (for a total of 40), I imagine that the steal occurred after say 18 seconds, then the opposition ran a play for 22 seconds before scoring.
Now, in your particular example, what I would imagine is that a timeout was called. I mean, how realistic is it that a timeout isn't called with 2 seconds left? And most teams have timeouts to burn at the end of most games. So, what "really" happened was: rebound with 2 seconds left, timeout that went unrecorded, get to inbound from half court, run a quick play and score on the buzzer.
By the book, that isn't what really/officially happened, and technically it's the "wrong" answer. But, I find for me personally, it spares me a fair amount of mental anguish trying to work out how it produces theoretically unrealistic results such as these and others.