Bain & Co., the Boston-based consultancy company that was hired to assist in restructuring South Africa’s tax agency in 2015, said it has become “painfully evident” that the firm’s involvement with the authority was a “serious failure.”