Who says you can't do that? They would be thrilled to have silicon valley (or equivalent) talent working for India salaries.
I doubt India government would grant a business visa for that.
They don’t want other countries citizens competing for jobs in their own country, which is effectively what is happening in the us now.
They do, and plenty of Westerners (Indian origin and non-Indian origin) return to India to work for Indian companies, found their own companies, or manage American operations.
Though, IME, it tends to be Japanese, Israeli, Singaporean, and Korean expats who can hack it in India. Western European and Americans are too soft.
I have not seen it happen in a permanent way.
I doubt a visa for generic remote based web dev work would get approved. In fact, I believe the visa even states you have to have a skill that is not readily available in India.
The reality is your generic dev would probably not qualify especially if they are outside of a company.
If it truly were free trade then we could choose to live there and accept a lesser salary.
Eventually offshoring to South America will probably hurt India as that is poised to expand and has overlapping timezones.