It turned out to be a bug related to module interface, as described in https://github.com/apple/swift/issues/56573.
In my case, 'MyFramework' had a singleton class named 'MyFramework'. Since adding Swift dependency to my module resulted in an invalid module interface, apps trying to import 'MyFramework' failed to build with a message '...' is not a member of class 'MyFramework.MyFramework'.