It can indeed be a different model that is loaded before the offending lock.mdl. The "bad format" message box appears when loading a model caused a crash. If the crash happened _after_ loading the model, the compiler can not detect it and crashes without message.

A damaged file often does not crash immediately, but leads to subsequent crashes, for instance when it is damaged in a way that loading it overwrites a wrong memory area.