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."