Can code "work" but still not be "correct"? For example, I might describe C code that relies on undefined but platform-specifically-reliable behaviours this way
Dependent types can't save you because the specification might be wrong. They might help you reduce the magnitude of your mistakes though (*if* you decide to use them for specification stuff, which is optional).