@jonduenas @Mcorey
I can confirm our team gets the exact same error in our project when we use SwiftLint as Build Tool Plugin (which came as part of a package dependency that we have access to).
After removal of the plugin the issue was resolved. We are using Xcode 15.3.
Apparently the issue is resolved in Xcode 16 Beta according to
https://developer.apple.com/documentation/xcode-release-notes/xcode-16-release-notes
Fixed an issue where projects using SwiftPM build tool plugins would sometimes report internal inconsistency errors when building. (121851192) (FB13565986)