"The Experiment" is comparing two different things. One's an issue of personal safety combined with elements of not fitting in, the other's an issue of not fitting in, combined with elements of career stressors.
You say it isn't all that different, but having experienced too much of both, it is.
Both are real, and sometimes both occur at once, but to say a white guy in a predominantly non-white and high-crime neighborhood would gain empathy for a non-white coder in a predominantly white tech company, would be as absurd as claiming the reciprocal.
A better comparison might be moving to a different country and getting a job there when you don't completely understand the culture and possibly have a language barrier (which I've gone through). You don't feel unsafe, but you don't quite fit in, you feel homesick, you don't mesh well with your coworkers, and you feel a constant background radiation of insecurity because you aren't used to the legal system, the social support system, etc. Your coworkers might make slight jokes about you. They mean well, but it sure as heck doesn't help your situation.
That feeling really (really) sucks. It must suck ten times as much when it's happening in your own country. I really feel for people who are forced to experience this.
The issue of personal safety is almost always overblown. The difference between the best part of town (i.e. where you feel comfortable) and the worst part of town (where you are uncomfortable), anywhere I've ever been, has been at most a relatively small degree. The perception of the issue is almost always caused by the "not fitting in" part.
Further, career stresses are frequently underplayed in the tech environment. Certainly, I would feel very little worry about saying, "Adios, and I'll leave my badge on my desk on my way out." On the other hand, if you are not part of the tech culture and everyone you know is either unemployed or working, say, outside the tech field, the potential of being punished simply for standing out is a bigger worry than I suspect you really think.
In other words, it isn't the same thing, but it's not as absurd as you might believe.
But those neighborhoods aren't really that dangerous. For example, many people go on vacation to places that are more dangerous than the worse neighborhoods in their town (Jamaica and Mexico come to mind). Even the "safe" places in those countries are more dangerous than the "dangerous" places in any average US town.
Personal safety is an extension of not fitting it - it's hard to read the cues about who or what might be a threat to you as opposed to a mere annoyance. Of course one is unlikely* to face a physical threat in the workplace equivalent to heading to a dive bar surrounded by broken bottles, but your career risk is just an abstraction of the corporal risk and can be just as stressful.
* as a man anyway.
I've also experienced a great deal of both and I disagree with your read. It's easy to think up non-racial examples as well; someone who's gay in a frat-themed work environment, or a middle-class guy ending up at a bar populated by Hell's Angels or suchlike. The differences with race and gender, obviously, are that it's almost impossible to obscure those facts about yourself so you can't even fake that you fit in.
Come now, I've spent plenty of time as the only white person in sight, and it never felt anywhere near as uncomfortable as walking by druggies, needles out, late at night. Or going through the empty NYC subways at 4AM. Or the guy who pulled a knife on me.
Social anxiety is real, but do you really find the fear of imminent injury/death no more terrifying than social harm?
The point is that there is this ridiculous misconception that everyone in "bad" neighborhoods is constantly being shot at. I just said go to one of those neighborhoods and do something like shop at a gas station or nightclub. I didn't say a thing about knives, druggies, or anything of the sort.
Fear of bodily harm is certainly far more acute, but it's also concentrated in time, even though it may be encountered regularly or frequently. While social anxiety is more of a chronic issue, I think it can be just as stressful in the aggregate - I did choose the word 'stressful' deliberately above.
You say it isn't all that different, but having experienced too much of both, it is.
Both are real, and sometimes both occur at once, but to say a white guy in a predominantly non-white and high-crime neighborhood would gain empathy for a non-white coder in a predominantly white tech company, would be as absurd as claiming the reciprocal.