There’s no grammatical error in that sentence, if you mean that, if he were able to go now, he would have gone back then. If you mean that he would have done something in the past if he could have at the time, you would say one of the following:
- Had be been able to go, he would have.
- Had he been able to, he would have gone.
- Had he been able, he would have gone.
- If he could have gone, he would have.
- If he could have, he would have gone.
- If he had been able to go, he would have.
- If he had been able to, he would have gone.
- If he had been able, he would have gone.
You can also reverse the order of the clauses, for example
- He would have gone if he could have.
- He would have gone if he had been able [to].
- He would have gone, had he been able [to].
“Had he been able to” is the past subjunctive, which is becoming old-fashioned but still is used for imaginary, counterfactual or hypothetical situations. “Were he able to” is the present subjunctive. You can tell that this is the subjunctive mood because were is being used with a singular subject.
In more casual speech, “He would have gone if he were able to,” or “He would have gone if he was able to,” are things many native speakers might say, even though the second clauses of both sentences would need to use a different tense in formal written English.
You can also supply the primary verb to go/gone in both clauses if you wish (“If he had been able to go, he would have gone.”) but it is more idiomatic to supply the full verb only once. It may or may not be left out of the sentence entirely if it is clear from context, such as, “He wanted to go. If he had been able to, he would have.” This makes it clear that “to go” is the verb omitted from both of the clauses following it.