What would happen if you added two inputs, one known and one unknown, both encrypted with a fully homomorphic encryption scheme, and then checked the result by dividing it by two? Wouldn’t this tell you if the data is identical?
Maybe you are looking for something like MPC, where parties want to compute a shared result, but need to keep their data private. Well, as you observed, the result of the computation can reveal more or less information depending on the security model and the number of parties involved. However, you can achieve secure multi-party computation using homomorphic encryption, as indicated in this paper On-the-fly Multiparty Computation on the Cloud via Multipkey Homomorphic Encryption. Unfortunately, the scheme described in the paper is no longer secure for practical computation as recent work by Ducas et.al proved.