The default behavior of the Relay type mutator when it encounters Global Type Variables is to create a new Global Type Var instead of passing along the existing one. This can lead to type checking errors, as the type checker relies on pointer equality for global type vars (the type solver unifies them by checking for structural equality, and the structural equality check looks at pointer equality).
Proposed fix: Have the default return the global type var unmodified. Alternatively, we shouldn't use pointer equality for global type vars.