It's probably the rear camera IC chip needing to be replaced if you already tried replacing the rear camera. I had it done for me once so I know it's possible.
You believe or not but for the first time when i dropped my phone the camera din't worked util few days after i accidentally dropped it again then i switched on. Unbelievably the camera started to work again