Repository: conan-io/conan
Issue: [bug] conan2 Assertion error when using override in downstream package in specific scenario

### Environment details

* Operating System+version: Ubuntu 22.04
* Compiler+version: gcc 11.3.0
* Conan version: conan 2.0.3
* Python version: 3.10.9



### Steps to reproduce

1. follow the instructions on: https://github.com/nicosmd/conan2-missing-override-bug

### Logs

```
conan create .

======== Exporting recipe to the cache ========
libc/0.1: Exporting package recipe: /home/user/dev/conan2-missing-override-bug/libc/conanfile.py
libc/0.1: Copied 1 '.py' file: conanfile.py
libc/0.1: Exported to cache folder: /home/user/.conan2/p/libc131a61a3214d9/e
libc/0.1: Exported: libc/0.1#423a07067eef81c2ee8b320fd2cb100c (2023-04-05 19:50:45 UTC)

======== Input profiles ========
Profile host:
[settings]
arch=x86_64
build_type=Release
compiler=gcc
compiler.cppstd=gnu17
compiler.libcxx=libstdc++11
compiler.version=10
os=Linux
[options]
opencv*:with_ffmpeg=False
opencv*:with_gtk=False
[conf]
tools.cmake.cmake_layout:build_folder_vars=['settings.arch']

Profile build:
[settings]
arch=x86_64
build_type=Release
compiler=gcc
compiler.cppstd=gnu17
compiler.libcxx=libstdc++11
compiler.version=10
os=Linux
[options]
opencv*:with_ffmpeg=False
opencv*:with_gtk=False
[conf]
tools.cmake.cmake_layout:build_folder_vars=['settings.arch']


======== Computing dependency graph ========
Traceback (most recent call last):
  File "/home/user/miniconda3/envs/conan2/lib/python3.10/site-packages/conan/cli/cli.py", line 272, in main
    cli.run(args)
  File "/home/user/miniconda3/envs/conan2/lib/python3.10/site-packages/conan/cli/cli.py", line 171, in run
    command.run(self._conan_api, self._commands[command_argument].parser, args[0][1:])
  File "/home/user/miniconda3/envs/conan2/lib/python3.10/site-packages/conan/cli/command.py", line 157, in run
    info = self._method(conan_api, parser, *args)
  File "/home/user/miniconda3/envs/conan2/lib/python3.10/site-packages/conan/cli/commands/create.py", line 69, in create
    deps_graph = conan_api.graph.load_graph_requires(requires, tool_requires,
  File "/home/user/miniconda3/envs/conan2/lib/python3.10/site-packages/conan/api/subapi/graph.py", line 123, in load_graph_requires
    deps_graph = self.load_graph(root_node, profile_host=profile_host,
  File "/home/user/miniconda3/envs/conan2/lib/python3.10/site-packages/conan/api/subapi/graph.py", line 172, in load_graph
    deps_graph = builder.load_graph(root_node, profile_host, profile_build, lockfile)
  File "/home/user/miniconda3/envs/conan2/lib/python3.10/site-packages/conans/client/graph/graph_builder.py", line 53, in load_graph
    new_node = self._expand_require(require, node, dep_graph, profile_host,
  File "/home/user/miniconda3/envs/conan2/lib/python3.10/site-packages/conans/client/graph/graph_builder.py", line 100, in _expand_require
    node.propagate_closing_loop(require, prev_node)
  File "/home/user/miniconda3/envs/conan2/lib/python3.10/site-packages/conans/client/graph/graph.py", line 82, in propagate_closing_loop
    prev_node.propagate_downstream(transitive.require, transitive.node, self)
  File "/home/user/miniconda3/envs/conan2/lib/python3.10/site-packages/conans/client/graph/graph.py", line 86, in propagate_downstream
    assert node is not None
AssertionError

ERROR:
```

Changed files:
conans/client/graph/graph.py, conans/test/integration/graph/core/graph_manager_test.py

diff --git a/conans/client/graph/graph.py b/conans/client/graph/graph.py
index 29c1094d3..cd944ea26 100644
--- a/conans/client/graph/graph.py
+++ b/conans/client/graph/graph.py
@@ -79,6 +79,8 @@ class Node(object):
         # List to avoid mutating the dict
         for transitive in list(prev_node.transitive_deps.values()):
             # TODO: possibly optimize in a bulk propagate
+            if transitive.require.override:
+                continue
             prev_node.propagate_downstream(transitive.require, transitive.node, self)
 
     def propagate_downstream(self, require, node, src_node=None):
diff --git a/conans/test/integration/graph/core/graph_manager_test.py b/conans/test/integration/graph/core/graph_manager_test.py
index ed65c86ca..c6b0a7710 100644
--- a/conans/test/integration/graph/core/graph_manager_test.py
+++ b/conans/test/integration/graph/core/graph_manager_test.py
@@ -1470,6 +1470,38 @@ class TestDiamond(GraphManagerTest):
         self._check_node(libc, "libc/0.1#123", deps=[], dependents=[libd])
         self._check_node(liba1, "liba/0.1#123", dependents=[libb])
 
+    def test_diamond_transitive_private(self):
+        # https://github.com/conan-io/conan/issues/13630
+        # libc0.1 ----------> liba0.1 --(private) -> zlib/1.0
+        #      \\-> --(libb---->/
+
+        self.recipe_cache("zlib/0.1")
+        self.recipe_conanfile("liba/0.1", GenConanfile("liba", "0.1")
+                              .with_requirement("zlib/0.1", visible=False))
+        self.recipe_cache("libb/0.1", ["liba/0.1"])
+        self.recipe_cache("libc/0.1", ["liba/0.1", "libb/0.1"])
+        consumer = self.consumer_conanfile(GenConanfile("libc", "0.1")
+                                           .with_requires("liba/0.1", "libb/0.1"))
+        deps_graph = self.build_consumer(consumer)
+
+        self.assertEqual(4, len(deps_graph.nodes))
+        libc = deps_graph.root
+        liba = libc.dependencies[0].dst
+        libb = libc.dependencies[1].dst
+        liba1 = libb.dependencies[0].dst
+        zlib = liba.dependencies[0].dst
+
+        assert liba is liba1
+        # TODO: No Revision??? Because of consumer?
+        self._check_node(libc, "libc/0.1", deps=[liba, libb])
+        self._check_node(libb, "libb/0.1#123", deps=[liba], dependents=[libc])
+        self._check_node(liba, "liba/0.1#123", dependents=[libb, libc], deps=[zlib])
+        self._check_node(zlib, "zlib/0.1#123", dependents=[liba])
+
+        _check_transitive(libb, [(liba, True, True, False, False)])
+        _check_transitive(libc, [(libb, True, True, False, False),
+                                 (liba, True, True, False, False)])
+
 
 class TestDiamondMultiple(GraphManagerTest):
 
@@ -1898,6 +1930,35 @@ class PureOverrideTest(GraphManagerTest):
         self._check_node(libb, "libb/0.1#123", deps=[liba], dependents=[libc])
         self._check_node(liba, "liba/0.3#123", dependents=[libb, libc])
 
+    def test_override_not_used(self):
+        # https://github.com/conan-io/conan/issues/13630
+        # libc0.1 ----------> liba0.1 --(override) -> zlib/1.0
+        #      \\-> --(libb---->/
+
+        self.recipe_conanfile("liba/0.1", GenConanfile("liba", "0.1")
+                              .with_requirement("zlib/0.1", override=True))
+        self.recipe_cache("libb/0.1", ["liba/0.1"])
+        self.recipe_cache("libc/0.1", ["liba/0.1", "libb/0.1"])
+        consumer = self.consumer_conanfile(GenConanfile("libc", "0.1")
+                                           .with_requires("liba/0.1", "libb/0.1"))
+        deps_graph = self.build_consumer(consumer)
+
+        self.assertEqual(3, len(deps_graph.nodes))
+        libc = deps_graph.root
+        liba = libc.dependencies[0].dst
+        libb = libc.dependencies[1].dst
+        liba1 = libb.dependencies[0].dst
+
+        assert liba is liba1
+        # TODO: No Revision??? Because of consumer?
+        self._check_node(libc, "libc/0.1", deps=[liba, libb])
+        self._check_node(libb, "libb/0.1#123", deps=[liba], dependents=[libc])
+        self._check_node(liba, "liba/0.1#123", dependents=[libb, libc])
+
+        _check_transitive(libb, [(liba, True, True, False, False)])
+        _check_transitive(libc, [(libb, True, True, False, False),
+                                 (liba, True, True, False, False)])
+
 
 class PackageIDDeductions(GraphManagerTest):