(1)Where a finding of guilty by a court-martial, which has been confirmed, is found for any reason to be invalid or cannot be supported by the evidence, the authority which would have had power under section 177 to commute the punishment awarded by the sentence, if the finding had been valid, may substitute a new finding and pass a sentence for the offence specified or involved in such finding:Provided that no such substitution shall be made unless such finding could have been validly made by the court-martial on the charge and unless it appears that the court-martial must have been satisfied of the facts establishing the offence.