Drupal 8+'s .info.yml version constraints for dependencies are weird!
The Drupal.org module development .info.yml docs version constraints for dependencies section informs that these constraints are custom Drupal and differ from composer version constraints. I don't think that's a good thing and in development it is confusing again and again, as it doesn't have as expected.
This might not be a problem, if your dependency just targets one version, but targeting multiple versions is really strange!
Examples and workarounds:
Instead of
my_module:my_module (^3 || ^4)
writemy_module:my_module (=3, =4)
my_module:my_module (>=3)
writemy_module:my_module (=3, =4)
otherwise the composer dependency might end in drupal/mymodule:^3
for strange reasons.
Perhaps you have similar cases and examples to add?
Hopefully this will sooner or later use the composer notation, but I didn't find a core issue for that yet.