Really? I see this every single time the subject is brought up. And, to be fair, they do catch some bugs, it's just that they do so at a cost.
>What the hell is customer? What is payment methods? What fields are available on these objects? What methods can you call on them? no freaking idea.
And, if they are all strings, how much more of an idea do you have?
Static typing does not necessarily help solve this problem - a combination of reduced scope(i.e. looser coupling), more specific variable naming and higher cohesion (e.g. having a customer object) do.
Moreover, there's a super easy way to figure out what all of those things are and figure out how you want to change it - run a behavioral test and launch a REPL when it hits that function.
At that point you can inspect customer, use autocomplete on it and even experimentally run code.
>If anything, static type checking helps experimentation because you can change your mind quickly and the compiler will help you catch all the stupid mistakes that can occur from mismatching types or mistyping variable names. This removes a huge cognitive tax and makes programming more enjoyable.
Behavioral tests perform this function equally well, if you have them.