This kind of failure is usually an issue with the project's Objective-C headers and clang modules. If ChatUserMessageSectionController is defined in Objective-C, please make sure it's part of a single clang module. If the same header is included in SPIM and a different module it may be confusing the compiler as it is seen as having different origins at different compilation steps.
The compiler outputs the following information which tries to explain the compiler confusion. You may want to build the same project with a Swift 5.5 compiler, it should provide more information under that message.