What crazy instability is this?

Confirming that the types are the same at run time is not sufficient. What matters is whether the compiler can determine the types at compile time. Have you tried using @code_warntype ?