You're right that it's a bubble, and that getting rid of the foreigners won't fix the job market for programmers, but absolutely wrong that we should be trusting them to write our software. I would venture to say most software involves handling payment details, and the security problems we're having now are the tip of the iceberg. The level of incompetence of Indian teams is alien; it's not at all like a beginner programmer who doesn't know what they're doing, and inviting more of that will only mean the average person getting their identity stolen more often, and more government/bank/other important stuff getting hacked by foreign actors.
What we've heard is certainly the tip of an iceberg. I suspect almost all of our shit is already hacked, and credit cards, mail, etc would stop working within hours if China really wanted that. Shitty software is a looming disaster right now, and while getting rid of H1Bs wouldn't entirely fix it, it would help a lot.