The thing that makes the H-1B and visas like it insecure is their being tied to employer sponsorship. I don't think that's inherently unfair - the whole point of the visa is to bring in skilled workers in valuable industries.
What I do think is shitty about the H-1B in particular is just how short the grace period is to find a new sponsor. 60 days is a tight schedule even for a skilled worker in a good market, and layoffs don't tend to happen in good markets. It definitely opens up visa holders to exploitation by employers, and temporary downturns can end up kicking out a lot of valuable people.
There are other countries with skilled worker visas with more generous grace periods - e.g. Ireland's Critical Skills Employment Permit allows you 6 months to find a new job if you're laid off. I don't see the problem with that if the visa holder can support themselves financially over that timeframe.
As a result of policy, H-1B workers will take substandard pay, abuse, and burdens to maintain a job with a company willing to sponsor them until they can get their Green Card. This creates a from of indentured servitude.
The knock on affect is that it lowers wages for everyone because there's a vast pool of skilled workers willing to accept lower pay from a company willing to maintain sponsorship of them for 10+ years.
Imagine on year 9 you get laid off, now your indentured servitude got extended another 10 years if you can find a new sponsor.
I completely understand the shittiness of this issue and I'm not from a developed country, but I mean, this is the reality of a temporary work visa, no?
I might be more pessimist/realist, but until I receive a permanent residency visa, I'd treat everything as temporary, ready to move back in a couple days notice.