Most bugs aren't type issues until you make them be type issues by expressing some business invariant in types.
Refactoring makes an exception not being caught the same way as before ? Type issue. Mixing up some ids ? Type issue. Etc.
Now that can also be emulated with extensive tests. But isn't that a concern for OP as well ?
perl another offender… is it a hash? is it an arrayref? over time you get it right, but by trial and error and looping. json suffers this too, arrays different from strings, different from numbers etc, but opaque until checked and liable to change