Not a lot of H-1B visa holders seem to be aware of this. I've been out-of-status many times since then. I've violated the rules of my H-1B visa multiple times, by (intentionally) taking several-months-long breaks between jobs. (Many many years ago, I even violated the terms of my F-1 student visa, and my university terminated my SEVIS record.) None of these past visa violations has affected me adversely, so far.

I've had several visas (including multiple H-1Bs) approved, regardless of my past visa violations. I've been careful to read up on the law. You can't be denied a visa you unless there's a clear basis for denial under the INA. Violations of status while you are within an "authorized period of stay" do not result in a bar.

Honesty is important though. There's a question in the DS-160 visa application form, that asks something to the effect of "Have you ever been illegal in the U.S.?" I've always been very careful to completely and honestly disclose all my past visa violations -- since dishonesty can you get you barred from the U.S. for life. My answer to that question in the DS-160 grows longer and longer, as the years pass. With every visa application, I list all my past violations, starting with my ancient F-1 visa violation. It's never been an issue.

There was one time a consular officer made a comment about it, but that was it. They've been more surprised by my salary. The last time I renewed my visa, post-Trump, they asked to see all my tax returns, and other information. The consular officer actually went through my tax returns in front of me, and seemed kind-of taken aback by my income, and made a comment saying "you've been doing quite well". Most of my visa applications have been at the consulate in Chennai.

I was also outside the US for a little while, 6 years ago, and during that time, I even got a B-1/B-2 visa approved, which is a non-dual-intent visa, and therefore harder to get approved. (The B visa is often denied for people with strong ties to the United States, under Section 214(b) of the Immigration and Nationality Act, which prohibits immigrant intent--and having lived many years in the US is likely a strong indicator of immigrant intent.)

The important thing to keep in mind is to be well-aware of the law, and of what can trigger lifetime/10-year/5-year/3-year bars. Dishonesty results in a lifetime bar. Being turned away at the airport results in a 5-year bar. Many H-1B holders were turned back in 2010 during the recession[1]. Actual unlawful presence results in 3-year or 10-years bars. Getting an NTA while on a temporary visa inevitably leads to a 10-year bar.

Violations of status do not directly result in a bar. Right now, USCIS can initiate removal proceeding (by issuing an NTA) if you file a petition requesting a change-of-status, while out-of-status. However, they don't go after people on humanitarian or employment-based statuses[2]. (Previously, under the Obama administration, officials in USCIS were actually prohibited from issuing NTAs or attempting to deport status violators.)

NTAs inevitably lead to 10-year bars because they give you a court date that's always over a year ahead in the future. You have the option to arrange "voluntary departure" on your court date. But if you leave before the court date, you're considered to have been forcibly deported, and a 10-year bar is slapped on you. If you wait until your court date, you accrue unlawful presence, and get a 10-year bar.

Even some corporate immigration lawyers aren't fully aware of the laws. My last company's immigration lawyers freaked out when they saw my visa violations, and thought there was no point in porting my H-1B since I surely was subject an unlawful presence bar (they must've thought my past approvals were all accidents). I had to actually provide them with links to the USCIS Adjuticator's Field Manual (AFM) pointing to the relevant sections of what counts as a bar (along with references to statutory (U.S.C.) and regulatory (C.F.R.) law) and show that them that I've never actually ever unlawfully present. They did a bunch of their own research, and then came back to me and said "you are right", and proceeded to file paperwork for my new job.

[1] https://redbus2us.com/why-were-h1b-holders-sent-back-at-port...

[2] https://www.uscis.gov/legal-resources/notice-appear-policy-m... -- Quote: "USCIS will not implement the June 28, 2018, NTA Policy Memo with respect to employment-based petitions at this time. Existing guidance for these case types will remain in effect."