When it comes to types, python is arguably easier to reason about than typescript, given that the in-code types are just for reference.
Typescript types can break even when they are actually valid. But it takes some intuition to know when to use the escape hatches, so I can see why an LLM would have trouble with it.
I wonder if LLMs would write javascript better than typescript too.