gf: avoid adding cache entries wider than the original method (#39140)
Sometimes we want to widen the compilation signature, but then end up
with something which does not fit the original pattern. This then can
cause problems later, when we try to use the Method (from the cache),
but discover it does not actually match the call.
Fixes #38999