I'm also experiencing the issue, when digging into the logs a bit further I noticed that the file I generate in the build command is failing to be generated. This doesn't happen locally or when building in Github Actions - so seems specific to Xcode Cloud? I wonder if it is to due with the write permissions of the pluginWorkDirectory being different in Xcode Cloud or because of where DerivedData is located...
Any suggestions on what steps I could add to the pre_xcodebuild.sh script would be really helpful!