              return (
                  queryset.filter(query),
                  lambda relobj: (
                      object_id_converter(getattr(relobj, self.object_id_field_name)),
                      relobj.content_type_id
                  ),
                  lambda obj: (obj.pk, self.get_content_type(obj).pk),
                  False,
                  self.prefetch_cache_name,
                  False,
 
</s>
                    getattr(relobj, content_type_id_field_name),
              return (
                  queryset.filter(query),
                  lambda relobj: (
                      object_id_converter(getattr(relobj, self.object_id_field_name)),
                    getattr(relobj, content_type_id_field_name),
                  ),
                  lambda obj: (obj.pk, self.get_content_type(obj).pk),
                  False,
                  self.prefetch_cache_name,
                  False,
keep keep keep keep replace keep keep keep keep keep
 Fixed #31190 -- Fixed prefetch_related() crash for GenericForeignKey with custom ContentType foreign key.

Regression in dffa3e1992562ba60512d96d1eb5859ffff2ceb5.
django/contrib/contenttypes/fields.py