So indeed attachEvent only does that when the ChangeType fails (no matter the error code).
Getting the mime type thing correct is challenging, but at least I managed to have all tests pass. I think I got it for the most part, and it should be fine for us to do it like this, but I had to add one "special case" in the tests for the w1064v1809 testbot VM because, for whatever reason, it uses the .htm extension to lookup the name, while .html is specified in the database. The CLSID also does not work correctly for it, either (it would show "HTML Document" instead of "HTM file")... I don't think this quirk is worth replicating.
Basically, first it looks up the Extension value in the database for that MIME type. If that is not found, or the extension lookup itself fails later or doesn't exist, it tries the CLSID from the database to obtain the ProgID.
I also test it in scripts via external.getExpectedMimeType, even though it seems overkill for now, because it will be useful later when testing more doc mime types (XHR response as well, for instance) and from others (anchors, etc). So it will be useful to have.