(g) Upon an appeal taken under subsection (f) of this section, the burden shall be on the commission to prove, based upon the evidence in the record compiled before such commission, that the decision from which such appeal is taken and the reasons cited for such decision are supported by sufficient evidence in the record. The commission shall also have the burden to prove, based upon the evidence in the record compiled before such commission, that (1) (A) the decision is necessary to protect substantial public interests in health, safety or other matters which the commission may legally consider; (B) such public interests clearly outweigh the need for affordable housing; and (C) such public interests cannot be protected by reasonable changes to the affordable housing development, or (2) (A) the application which was the subject of the decision from which such appeal was taken would locate affordable housing in an area which is zoned for industrial use and which does not permit residential uses; and (B) the development is not assisted housing. If the commission does not satisfy its burden of proof under this subsection, the court shall wholly or partly revise, modify, remand or reverse the decision from which the appeal was taken in a manner consistent with the evidence in the record before it.