There were plenty of new tech jobs to replace the lost ones, but those got relentlessly outsourced and swamped with H1-Bs.
Compare the USPS-related losses to the number of H1-Bs. Even if you’re generous with calculating jobs on the former, it is swamped by the losses to Americans on the latter.
H1Bs are part of the problem, but many more jobs disappear due to the jobs going to people in other countries who can just email the work product where it needs to go. No need for any immigration processes at all.