diff --git a/src/graph/GraphView.cpp b/src/graph/GraphView.cpp
index fab9be91556c5ffc0bd446edcbc5abb80e99a1bb..26c693152f18270d3cb4012567b9b6bd69772bb6 100644
--- a/src/graph/GraphView.cpp
+++ b/src/graph/GraphView.cpp
@@ -1115,6 +1115,10 @@ void Aidge::GraphView::insertParent(NodePtr childNode,
 }
 
 bool Aidge::GraphView::replace(const std::set<Aidge::NodePtr>& oldNodes, const std::set<Aidge::NodePtr>& newNodes) {
+    AIDGE_ASSERT(!(oldNodes.size() > 1 && newNodes.size() > 1),
+      "GraphView::replace(): old and new sets cannot both have more than one node (here: {} and {} respectively). Use GraphView instead of set in this case.",
+      oldNodes.size(), newNodes.size());
+
     // (1) create GraphViews from both sets of Nodes
     auto oldG = std::make_shared<GraphView>("oldG");
     oldG->add(oldNodes, false);