diff --git a/vendor/magento/module-shared-catalog/Model/ProductManagement.php b/vendor/magento/module-shared-catalog/Model/ProductManagement.php
index 999815c356b..aa741c4ec72 100644
--- a/vendor/magento/module-shared-catalog/Model/ProductManagement.php
+++ b/vendor/magento/module-shared-catalog/Model/ProductManagement.php
@@ -5,9 +5,12 @@
  */
 namespace Magento\SharedCatalog\Model;
 
+use Magento\Catalog\Api\Data\ProductInterface;
 use Magento\Catalog\Model\ResourceModel\Product as ProductResourceModel;
 use Magento\Customer\Api\Data\GroupInterface;
 use Magento\Framework\Api\SearchCriteriaBuilder;
+use Magento\Framework\Exception\InputException;
+use Magento\Framework\Exception\NoSuchEntityException;
 use Magento\SharedCatalog\Api\CategoryManagementInterface;
 use Magento\SharedCatalog\Api\Data\ProductItemInterface;
 use Magento\SharedCatalog\Api\Data\SharedCatalogInterface;
@@ -142,23 +145,9 @@ public function assignProducts($id, array $products)
         $sharedCatalog = $this->sharedCatalogInvalidation->checkSharedCatalogExist($id);
         $customerGroupIds = $this->getAssociatedCustomerGroupIds($sharedCatalog);
 
-        $skus = [];
-        $ids = [];
-        foreach ($products as $product) {
-            if ($product->getSku()) {
-                $skus[] = $product->getSku();
-            } elseif ($product->getId()) {
-                $ids[] = $product->getId();
-            }
-        }
-        if (!empty($ids)) {
-            $skus = array_merge($skus, array_column($this->productResourceModel->getProductsSku($ids), 'sku'));
-        }
-        $skus = array_unique($skus);
-        $ids = [];
-        if (!empty($skus)) {
-            $ids = array_values($this->productResourceModel->getProductsIdsBySkus($skus));
-        }
+        $idsBySkus = $this->getProductsIdsBySkus($products);
+        $skus = array_keys($idsBySkus);
+        $ids = array_values($idsBySkus);
 
         $categoryIds = $this->sharedCatalogCategoryManagement->getCategories($sharedCatalog->getId());
         $productsCategoryIds = $this->categoryProductLink->getCategoryIds($ids);
@@ -270,4 +259,46 @@ private function getAssociatedCustomerGroupIds(SharedCatalogInterface $sharedCat
 
         return $customerGroupIds;
     }
+
+    /**
+     * Load products IDs by SKUs.
+     *
+     * @param ProductInterface[] $products
+     * @return array
+     * @throw InputException
+     */
+    private function getProductsIdsBySkus(array $products): array
+    {
+        $skus = $ids = [];
+        foreach ($products as $product) {
+            if ($product->getSku()) {
+                $skus[] = $product->getSku();
+            } elseif ($product->getId()) {
+                $ids[] = $product->getId();
+            }
+        }
+
+        if (!empty($ids)) {
+            $skus = array_merge($skus, array_column($this->productResourceModel->getProductsSku($ids), 'sku'));
+        }
+        $skus = array_unique($skus);
+        $idsBySkus = $this->productResourceModel->getProductsIdsBySkus($skus);
+
+        $notExistingSkus = array_udiff(
+            $skus,
+            array_keys($idsBySkus),
+            fn ($sku1, $sku2) => strtolower($sku1) <=> strtolower($sku2)
+        );
+        if ($notExistingSkus) {
+            $exception = new InputException();
+            foreach ($notExistingSkus as $sku) {
+                $exception->addException(
+                    new NoSuchEntityException(__('Requested product doesn\'t exist: %sku.', ['sku' => $sku]))
+                );
+            }
+            throw $exception;
+        }
+
+        return $idsBySkus;
+    }
 }

