When calling emitArrayDestroy(), the pointer will usually have ConvertTypeForMem(EltType) as the element type, as one would expect. However, globals with initializers sometimes don't use the same types as values normally would, e.g. here the global uses { double, i32 } rather than %struct.T as element type.
Add an early cast to the global destruction path to avoid this special case. The cast would happen lateron anyway, it only gets moved to an earlier point.
I think I have a similar question here. I understand that globals don't always have the right type because of initializers, but the code that's emitting the reference to the global generally ought to be casting it to the right type instead of forcing all the downstream code to cast.