@kuba But that's how dynamic libraries work in large part? This is why we have the major version number in soname (https://tldp.org/HOWTO/Program-Library-HOWTO/shared-libraries.html#AEN49). If you linked against libfoo.so.5, the dynamic linker will search for libfoo.so.5 and it's of no concern to it that libfoo.so.1 or libfoo.so.51234 exist.
One issue is when you need libX.so.1 and libY.so.5, but the installed version of libY needs libX.so.2. Sometimes this could work, but doesn't due to the flat namespace of symbols (this is the problem that glibs tries to combat by symbol versioning). But in some cases this can't work even in principle: if you want to pass objects from X to Y, you _need_ to use the same version of X.