I suggest the following code instead:
       public static bool ExTryGetValue<T>(this IAppCache service, string key, out T? value) where T : class
       {
           var item = service.Get<T>(key);
           if (item is null)
           {
               value = null;
               return false;
           }
           value = item;
           return true;
       }