I landed on this as the simplest most performant option because it uses SQL to make the exclusion:
favorite_products = Product.where(id: current_user.product_ids).by_category(@category.id)
favorite_shop_products = Product.where.not(id: current_user.product_ids).by_shop_category(current_user.shop_ids, @category.id)
@products = favorite_products + favorite_shop_products