I digged in the standard, although it's fairly cryptic to a beginner, my guess is that the section "[basic.lookup.argdep]" (section 6.5.2 in C++20 DIS N4860) describes the behaviour. Am I correct?
For each argument type T in the function call, there is a set of zero or more associated namespaces and a set of zero or more associated entities (other than namespaces) to be considered. The sets of namespaces and entities are determined entirely by the types of the function arguments.
Surely this is a pretty confusing feature! I imagine this might cause some unwanted side effects.