Your conclusion is incorrect: Erasure occurs in both cases, and in the same way. The difference is that the EnumMap object keeps a reference the class object for its key type in a field, and uses that class object to perform a reflective cast. That is what is causing the exception, as you can tell from the stacktrace.
In contrast, an ordinary map uses an unchecked cast, which succeeds even if the object is of an incorrect type (giving rise to heap pollution).