Actually that's the worst and by far most shitty solution ever.
Highly educated immigrants that actually contribute to the country are very rare. There simply aren't enough of those to go around and every country wants them.
The shitty immigrants, uneducated people from shitty countries, will bring their shitty problems with them and they are also very likely to rely on benefits. So instead of them helping out your country the shrinking labour force now has to support the elderly and a giant amount of useless immigrants without education and no perspective at all in the job market (which is currently happening in Germany for example).
On top of it all if you take in enough immigrants to actually combat population decline it means that you will have replaced your whole population within 2-3 generations. This is bound to come with MASSIVE cultural problems, I'd bet that no society on this planet can survive this much cultural stress without a civil war.
No, immigration is not even remotely a solution to population decline. It's nice to get a few highly educated immigrants in (as many as possible - but there simply aren't that many to begin with), but you really have to get your own population to reproduce if you want to survive in the long run.
Or help out artificially, growing the population in tubes would work, too
That doesn't quite count. Yes, sure, nobody can make economic predictions about interest rate movements etc. for 30-50 years. Because these things change on a scale of a year and making predictions about something that changes every year for 30 years is hard.
But populations don't change every year. They change in generations. So when talking about populations, a prediction of 30-50 years is like making an economic prediction of 1-2 years only.
Not necessarily perfect but possible.