The recently retired South African ambassador to Israel has taken a parting shot at the country's treatment of Palestinians, calling it a "replication of apartheid."