You can use same If expression for to update message saying that string is not in correct format if it has only one parenthesis
if(and(contains(variables('a'),'('),contains(variables('a'),')')),replace(variables('a'),slice(variables('a'),indexOf(variables('a'),'('),add(indexOf(variables('a'),')'),1)),''),if(or(contains(variables('a'),'('),contains(variables('a'),')')),'Not in correct format',null))
so this code checks first whether it has both closed and open brackets, if yes it will replace the values within parentheis with null, else it will check whether it contains open parentheis or closed one, if yes then it will say Not in correct format, else if does not contain any parenthesis, then it put result as null, which i have higlighted in above expression. You can replace with any other value or the variable itself so that it will display the same value 🙂
Hope it helps !