Thanks for pointing this out!
Also, the stress to apply for residency forces many immigrant scientists to choose to work on research fields with quick and easily-publishable outcomes, avoid adventurous projects. (Green card application evaluate your contribution by citation)
Many people have no idea how these things work.
For example, right now, as a Brazilian, I can't accept invitations to speak at conferences in Europe because my visa to work in the U.S. has expired.
I am not illegal; I have a work contract with the University of California until 2027. Still, I must travel outside the U.S. and get a visa stamp on my passport to allow me to move freely to talk about science.
I have to do this every single year I stay in the U.S. The costs of the visa, traveling, time lost, etc, are all on me. Not every international scientist can handle this.