Mtawarira, known as 'Beast', was ruled out after he had a recurrence of his condition ahead of last Saturday's Test against Ireland. He was admitted to a Dublin hospital and discharged within hours after routine tests.
Team management said Mtawarira will return to South Africa later on Monday.
The decision to bring in Malherbe, a 21-year-old from Western Province, was taken as Jannie du Plessis has a mild ankle sprain he sustained in the 16-12 victory over the Irish.
"We've consulted with Beast and his cardiologist in Durban and although it's safe for him to play, we decided it would be best for him to return home and rest," Springbok coach Heyneke Meyer said.
"The player's welfare is the most important consideration at this stage."
The 27-year-old loosehead travelled with the rest of the Springbok squad to Edinburgh on Sunday ahead of this weekend's second match of their three-match tour.
"This condition is not life threatening, but needs to be managed properly which is why we thought it would be in Beast's best interest to return to South Africa," said team doctor Craig Roberts.
"He needs to have a repeat of the minor procedure he had in Cape Town earlier this year and it's important to notice that he is not at risk by playing with it, and his career is not in jeopardy."