I agree that a competent, experienced developer can do this. What's worth noting, however, is that it takes two weeks to cross the bar of "can contribute code in this language that produces deliverable results". But two weeks cannot get you across the bar of "can contribute robust, maintainable code in this language".
Even though you are not a beginner to programming, you are a beginner to the language and its ecosystem and so will still make some significant newbie mistakes. Ruby on Rails is a good example of this: half of being good at RoR is being a good programmer, the other half is memorized knowledge of the idioms and patterns of the framework and community.
Unfortunately, this is so true and yet so difficult for people to realize and understand.
I've seen in real life wherein somebody hired at a supreme decision-making authority comes in and says "We'll rewrite everything in language X". Existing folks in the team quickly start ramping up on the language and simultaneously writing production code. Much of the code thus written tends to be pathological.
So do 10 years of experience. "robust, maintainable code" is just coding convention that a group of developers comes up with. The convention can vary from one team to another.
That sounds about right for many programming languages. My personal average from "having heard of the language" to "writing non-trivial programs" (let's say, something that is able to talk to a REST API and do some processing) is a non-stop weekend programming session. [1]
The time-consuming part is learning the libraries and how to write idiomatic code. That can take months or years (C++, I'm looking at you).
Still, knowledge of a specific programming language is usually the wrong thing to optimize for. Perhaps a more useful metric was the number of programming languages one has been exposed to? That is more useful, as once you have learned a bunch, you've seen most of the important concepts, and can focus on whatever subset is implemented by the new language.
[1] Except Haskell. That's a nut I still haven't cracked.
Filtering these clowns out should be rather simple (make sure their resume mentions at least a few different languages and ask the right questions during a phone screen), but most companies aren't willing to expend the effort.
One should also be vary of the other extreme: There are people that switch their favorite language every three months, and insist that they use the latest one for their day job. If you allow it, it may lead to lot of wasted time, small wars within your team, and so on.
I prefer Alan Perlis' advice: "A language that doesn't affect the way you think about programming, is not worth knowing."
Edit: I categorize myself as one of the programmers who can learn syntax, but it takes me much longer to understand the language.
The game these employers have set up is unwinnable. Don't play it.
If you already know Java and Javascript, you'll get Scala / Kotlin in no time. If you're experienced in Python and Django, RoR is a few weeks away. If you're experienced in C++ and Python, it won't take long until you're good to Go.
I get that companies want someone who's productive from Day 1, but they're missing out on a lot of great candidates that might only be productive from Day 15, but they'll be a lot more productive over time.