Your stack trace stops just before where the issue is happening, but the GWT compiler believes that you are using code in an impossible way, and is forced to emit an error message to correctly compile out impossible code. Roughly, the "throw ClassCastException unless null" check means that there is some cast that must always fail - nothing ever implements the interface, or nothing ever calls the constructor. In draft mode, the compiler couldn't prove this, but when you were building for production, the compiler is confident that this is impossible.
What is likely happening is that you are doing an unchecked cast of some kind, possibly a native JS type to a @JsType-annotated interface that isn't marked as isNative=true or the like. In this scenario, the compiler knows that no native types could implement the interface, and since it sees no non-native types that implement it, there must be no such types, so any calls to the interface's methods are actually errors. Further, any code that would come after such a method call can never be called.
Look at the next frame up the stack trace, and see if you can tell what method call is being optimized out in this way. Probably you'll see that it either comes from a class or interface that can't be directly instantiated, but somehow (likely an unchecked cast) you have an instance of that type anyway.
As to correctness, this is a good check to have, as it removes impossible code, which _usually_ you don't want to have. Incorrect code can often lead to impossible code, but there are many reasonable cases where this check should be emitted, so it isnt necessarily wrong for a compiled application to have this.