If the company which did the installation was negligent, or unreasonably careless, in installing the wrong water heater, they would be liable for the cost or installing instead the correct one. (This would not apply if you gave them wrong information and that is why they installed the wrong water heater.)