Some Xcode caching or code signing bugs can cause this. To fully reset, try revoking all certificates and profiles and re-downloading them to Xcode. Also, enable Xcode-managed profiles if needed.