What I would do, because cooling is the majority of your cost is run a 400-450 volt open circuit solar array, grounded in the middle of the array so you have plus and minus 200 volts..
Use an off the shelf 5 or 7.5hp VFD to drive your 4? ton HVAC compressor directly. good ones have pid control that can be wired to your thermostats.
The vfd will have a dump resistor that will be turned on at all times from a 400 volt array, the vfd will pwm that dump resistor.. (your 4500 watt hot water heater element will work) and drag the voltage down to somewhere around 400 volts.
a second 4500 watt element wired in series with the hot water heater, located to dump the heat outside, and a single SPDT relay, can be configured to short out either the outside resistor, or the inside hot water heater element, without open circuiting the dump load for more than 2 milliseconds. The VFd brake resistor will never be open circuit, it will be two resistors in series. Wire that spdt to a thermostat on the hot water heater.
If the dump load fails, the 450 volt open circuit voltage is not high enough to destroy the vfd.
About the hvac compressor. i prefer dumb compressors over inverters. they just don't survive long enough to pay for themselves especially if you have to pay a contractor 20 grand for a 5 grand system, or have to pay someone a grand, to replace the inverter ECM fan motor.
A single phase 4 ton scroll compressor draws 16 to 25 amps on the run winding at 60hz and it pulls 4 or 5 amps through the run cap. get rid of the run cap, add a 240v to 120v transformer rated for 5 amps on the 120v winding, and you can drive most single phase compressors directly from a 3 phase vfd. 45hz minimum in my experience for scroll compressors. probably 75hz max unless its an inverter rated compressor designed for a wider ratio.
(the 240:120tx gets wired up as a modified scott t transformer to make 2 phase, and shift the third leg on the vfd to match the compressors interconnected L winding of which you can only access 3 wires, not 4. you may need a second, 240v to 24-48v to get more current through the "start" winding. but it only needs to pass 5 amps on the secondary, to add some volts to the start winding)
When your hot water heater fails, buy an inverter heat pump water heater if your hot water needs justify it. they still have 4500 watt elements you can wire up as previously described.
If you don't need that much hot water, add a desuperheater heat exchanger to the discharge line from the scroll compressor.
in the winter, use the heat pump to heat your home, and it will also heat the hot water heater through the superheater. use gas for backup heat.
wiring diagram for the compressor and transformer arrangement from a vfd or from a 3 phase source such as a generator or utility
https://imgur.com/xuaTaEE