Of course, the rubber band theory. I took stem courses with guys from 3rd world nations that were extremely talented in math. One guy from Nigeria I worked on a course project with spoke 5 languages and prided himself on doing all the technical calculations. ( which I happily let him.

) But let's be honest. There are exceptions in everything. Their best and brightest tend to come to 1st world nations for an education. But this mass flooding of the 1st world with masses of individuals that we are seeing now is a whole different animal. When you look at the aggregate population of 3rd world countries, they are 3rd world for a reason. Third world people, 3rd culture, and 3rd world ways create 3rd world conditions. And in most cases, it has little to do with luck or natural resources. Let them keep flooding in and you will become a poor 3rd world nation with plummeting education scores. In reference to dropping scores in Sweden etc, this is the simplest explanation and newly introduced variable other than our institutions of "education" focusing on leftist social engineering and participation trophy nonsense which is probably certainly part of the issue. You would also diminish test scores when the teachers have to overcome language barriers. It's hard to teach or learn properly when classes are being increasingly filled with kids who do not speak the native language. It would have to hamper the learning of everyone in the class.
I think you're conflating several different things that need to be separated if we're actually trying to explain declining educational outcomes.
There is a legitimate argument that large-scale immigration can create challenges for a school system, particularly when substantial numbers of students enter classrooms without sufficient proficiency in the instructional language. That can require additional resources, affect classroom dynamics, and make it more difficult for teachers to maintain the same pace. That's a real variable worth examining.
But that's very different from concluding that people from "third world countries" inherently bring "third world ways" that cause "third world conditions." That's a sweeping cultural and biological-sounding generalization that doesn't actually establish the causal mechanism you're claiming. The fact that a country is poor doesn't mean its individual immigrants have the characteristics that caused the country's poverty, just as the fact that someone immigrates from a wealthy country doesn't make them inherently more capable.
Your Nigerian example actually illustrates the problem with the aggregate argument. If you're acknowledging that highly educated and exceptionally capable people from developing countries routinely excel when given access to Western institutions, then you have to account for the enormous variation within those populations rather than treating national origin as a proxy for ability or culture.
There is also an important distinction between immigration composition and immigration volume. If a particular school suddenly has a large influx of students who don't speak the instructional language, it's reasonable to ask whether that affects the performance of existing students. But demonstrating that effect requires controlling for things like socioeconomic status, parental education, age of arrival, prior educational attainment, school funding, neighborhood concentration, and the composition of the immigrant population. Otherwise, declining test scores occurring alongside increased immigration don't by themselves demonstrate that immigration caused the decline.
And I wouldn't dismiss the possibility that educational ideology, curriculum changes, declining standards, socioeconomic conditions, or changes in classroom discipline are contributing factors either. Those hypotheses can be tested. The same should be true of immigration. If we're going to identify the "simplest explanation," we need evidence that isolates the effect of the variable rather than simply identifying a variable that changed at roughly the same time.
So I'd agree with the narrower proposition that rapid immigration and language barriers can create measurable educational challenges. I don't think the evidence justifies jumping from that proposition to "third-world people create third-world conditions." That's a substantially broader claim, and it requires substantially more evidence.