These isolated cases without incident don't really matter in the context of society-wide taboo, however.
Coffee and cocaine are worlds apart. Most people don't have jobs that would work with a coke addiction. Freud was exceptional and I think he did most of his influential work not under the influence anyway.
I have no caffeine tolerance as I rarely use it. Every time I have an espresso, the experience is practically identical to doing a bump of cocaine. The effects are so similar it's something I'll do when feeling nostalgic about past coke-filled city life years. I've been assuming others who enjoy an occasional espresso have similar memories being relived by the sudden stimulation it delivers.
Speaking of those coke-filled city life years, quite a few of my peers developed expensive coke habits and they were perfectly functional and many climbed their respective corporate ladders quite successfully while addicted to this substance.
The only thing separating cocaine and caffeine by a gap miles apart is cost and access.
If you can afford and access clean product, coke is a very productive and perfectly functional drug. I suspect most sociopathic high-level executives use it regularly, as it really amplifies that side of one's personality, which isn't necessarily undesirable for leadership roles at large organizations.
Don't forget cocaine once was in Coca-Cola. That wouldn't have occurred if it interfered with people's jobs.
I was agreeing with the sentiment of your post up until this point, I too cannot withstand caffeine, the most I'm willing to consime is found in most Kombucha and even then I try to break it into 3 servings now. I've worked in 2 Industries where Cocaine use is as common as coffee is in an normal office setting, its pretty alarming at times. The mood swings and emotional instability from constant use is something I don't think it lends itself to well-being, and 'productive' is a useless word in that context: if you close 5 deals and make the business a ton of money that day you're productive, but if you got there by raging, anting and throwing stuff at people who no longer want to give you leads or access to their sales pipeline what's the point?
Funny story, I was just re-watching Bourdain's podcast with Joe Rogan and they said that in England coffee shops were seen as dens of sedition and were being shut down, because prior to that mead was the drink of choice for the working class. Which lead to mass intoxication and made the effective rule of the Monarchs absolute; it was when they were 'sober' that it led to things like the Magnacarta was supposed to usher in (Workers Rights, Property Rights etc...)
Personally speaking my palate is too sensitive, which affects my current role as a chef, if I drink coffee (which smells and tastes like burned food) I cannot taste things correctly for hours. I will however de story cans of Thai Tea.
I say all this as a person with zero cocaine experience, but lots and lots of caffeine experience. Stims don't make you better (usually worse, actually), but they do have a relationship to quantity of output.