We had the same issue, maybe the following things you can try to fix it:
By adding --versbose at the end of the fastlane command, there are more details, you might be able to find something useful.
Check the gym log, in our case, it is the gym log shows the right direction to fix this issue.
Our issue contains two parts:
It complains that the target contains macOs which is not included in the distribution file, so by removing the macOs from the General tab can fix this error
Some of the Pods don't have developer team selected, which is new on XCode 14, I think this might be some kind of bug in the new XCode. But the fix is also easy, this post is very helpful. (https://stackoverflow.com/questions/72561696/xcode-14-needs-selected-development-team-for-pod-bundles/72600584#72600584)
After fixing the above two errors, my build is working fine. Hope the solution helps.