I am facing the above issue. I have checked the mention path and found that It is not a directory, It is a valid executable path still facing the same issue.
Details are below:
Executable Path is a Directory
Domain: DVTMachOErrorDomain
Code: 5
Recovery Suggestion: /Users/apple/Library/Developer/Xcode/DerivedData/project name-hjamepccgssuuxegmglcegpnsvkp/Build/Products/Debug-iphoneos/projectname.app is not a valid path to an executable file.
User Info: {
DVTErrorCreationDateKey = "2023-06-12 12:59:16 +0000";
}
--````