The problem with disconnecting charge controller output while receiving PV input has been discussed
on other forums. It is caused by a maximum power point controller trying to switch the inductor stored
energy into an open circuit. Could be 100's of watts with no place to discharge except internally.
Magic Smoke. BUT , if the inverter is still connected, it's input circuitry can absorb that.
So, disconnecting all outputs from a MPPT can damage most of them. Disconnecting only battery is safe,
as long as inverter is on.