We can argue about the extent to which an employer should balance hiring for existing skills and hiring for potential to learn, but you can’t claim the latter unless you can point to prior success at learning new skills.
The punchline is that the interviewer hires a car salesman who’d sold brown cars with walnut interiors. Our hypothetical carpenter was effectively arguing that even if he’d only ever hammered together pine stud walls he could easily learn to do finish carpentry with walnut for a client very particular about his browns.
Given all of the above, the true subtext of this “joke” is that calling yourself a programmer entitles you to a job.
But the really galling part is that the “calling yourself a programmer” bit .
If a programmer walked into an interview and gave answers this evasive about how many projects he’d done in Java, he’d be an obvious no-hire.