Exactly this. The ability of LLMs to write code is going to strongly depend on the availability and quantity of training data. But agentic coding is more than just LLMs, it is also the various abilities that give feedback to the LLM to refine the resulting code...and that is something that strongly typed and statically typed languages do so much better than their weak/dynamic counterparts.