I mean how can you define a sensible way to subtract Infinity from an array, or add an object to a string?
TypeError.
There are also various sensible ways, for example if you have an array of floats, subtracting Infinity from the array could result in an array of the same length as the original, with each value being negative Infinity. But in general inhomogeneous types should not be addable without careful thought to create a type system which is consistent and coherent. That is exactly what JavaScript did not do.
It doesn't "handle bad code gracefully"; it handles it in a way that's hard to reason about and hence hard to work with.
The way JavaScript defines it is predictable
You literally just failed to predict it, so I don't think there's any point continuing this conversation.