It's also the case that taxi drivers need to eat, use the toilet, do their shopping, see the sights, etc. They aren't robots, and they don't necessarily have to dash to the next customer in a mad scramble for survival.
Imagine if somebody made a visualization of your workday and put it out in public. Would your manager say "he seems to just wander around aimlessly instead of efficiently moving from one piece of code to the next. I thought after compiling one project, they would all immediately head to the next one."
The analogy is ok, but mostly fails because as a developer, we are not paid commission for each line of code written. Whereas taxi drivers have a very strong profit motive to act efficiently and quickly. I think your examples of why they would deviate from this believed behavior is pretty solid on its own.
Imagine if somebody made a visualization of your workday and put it out in public. Would your manager say "he seems to just wander around aimlessly instead of efficiently moving from one piece of code to the next. I thought after compiling one project, they would all immediately head to the next one."