The right click trick works only if the app is not signed. If the app signature is invalid it won't work. You have to disable gatekeeper completely to open the invalid Xcode version.
Is it possible that the malware version of Xcode had its signature removed?