Outsourcing efforts at companies usually start with part of the workforce / couple of projects outsourced to a major outsourcer. This gives them partial insider information on the competence / political scenario / compensation in the company. I wouldn't be surprised if TCS worked with company management to figure out who would be retained based on these 3 variables and let others go without their fair shot even if they were qualified.
While this sucks for a candidate, I don't think you can allege discrimination based on this.
I am not fool enough to think a cost-arbitrage company would hire an American as their first second or third option. Its a given that its only last resort for most cases and that too, it skews to the extremes of competence or keeping the politics stable.
https://www.merriam-webster.com/dictionary/cast
As someone who's switched jobs on an H1 twice, I can tell you it's simply not true. It's a common misconception because earlier you couldn't change jobs on an H1 but the law around that was changed almost 10 years ago. If you have in-demand skills in 2018 Silicon Valley (JS, Java, Python, anything ML, big data, distributed systems or data science will work a treat) you're going to have recruiters contacting you regardless of your visa status.
From my limited knowledge of consulting companies (spent 8 months at the beginning of my career at one), a lot of their employees get very job-specific training in older technologies, understandably because that's the stuff being outsourced. That may be why they felt unable to move - their skills weren't in-demand anywhere else.
see: "If Employer A is unwilling to go through with the employment offer, the case ends. In that event, the I-485 case cannot proceed, as there is no intent to employ the sponsored worker. The same would be true if the sponsored worker is unwilling or unable to work for the sponsoring employer and wants to stay with the new employer, in this example, Employer B."
My friends from India have been waiting 8 years, paid hundreds of thousands in US taxes and are still years away from getting their GC. So I can say with complete certainty that this figure is incorrect. I wish it weren't. But we have an obligation to understand the law and the situation as it exists rather than as we wish it did. These are real people with families, houses, etc. who are afraid every day that by the whim of their employer they'd have to pack up their whole lives and leave at the drop of a hat. No one deserves that.
Your Indian friends have been waiting 8 years because their turn in line hasn't come yet. The place in line refers to the date of the most recent application that was granted a green card - the date your GC application was filed is known as a "priority date".
For Indian and Chinese nationals with Master's degrees, applications with a priority date of around 2009 are only now receiving green cards. This is the "8 year wait" that your friends are referring to.*
If someone with a priority date circa 2012 were to change their job right now you are correct that they would need to "restart the green card process" at their new job. A new green card application takes between 1 and 2 years. But it doesn't matter because their priority date is at least 3 years away anyway. And the new green card application at their new job can re-use the same 2012 priority date from the old GC application by the previous employer - so they'll receive their green card at the same time as they would by staying at their old employer.
*The only reason this line exists for Indians and Chinese is because green cards are apportioned by the applicants' country of birth, without regard to the population of that country. Since India and China are by far the largest countries in the world, they simply have more applicants than anyone else. Put another way, a Master's degree holder from the Seychelles could get a green card in the same amount of time as a Canadian or an Eritrean or Italian or Brazilian - between 1 and 2 years. I think this whole country of origin business is silly, and not just because it affects me personally. There is a rule change proposed in Congress to address this issue: https://www.congress.gov/bill/115th-congress/house-bill/392
I am not judging. I understand why people make this choice - Better life in US. Unfortunately, this comes at a price which no one is liking.