After some investigation, I identified the problem: I use modular architecture and the issue was that Sourcery couldn't resolve a parent protocol located in another module when generating mocks for a child protocol in the current module. Since Sourcery processes only the specified source files, it lacked the necessary context for the parent protocol.