Maxwell -- who stepped back from Australia duties in October saying he needed a break to deal with mental health issues -- had been named in the one-day and Twenty20 squads to face the Proteas from February 22.
Maxwell will have arthroscopic surgery on his left elbow on Thursday to fix loose fragments of bone and is expected to be out for between six and eight weeks.
"Representing Australia is the highest honour in cricket and something I cherish," Maxwell said in a statement.
"I was not confident that I could perform at international level with my elbow in its current state and have decided to undergo surgery straight away to fix the issue."
Cricket Australia announced he will be replaced by D'Arcy Short in both formats.
Maxwell had been picked after blistering form with the Melbourne Stars in the Big Bash League, where he has scored 398 runs at an average of 39.80.
The 31-year-old has played 110 one-dayers and 61 Twenty20s for Australia.
"An opportunity has now presented itself for D'Arcy and we're confident he'll make the most of whatever opportunities come his way in South Africa," said selector Trevor Hohns.