If he sells his R40k loan to the remaining member for R30k, wouldn't the resigning member make a R10k capital loss (R40k - R30k)?
yes correct.

If the loan cannot be repaid in a reasonable time then it is impaired, probably right down to zero, which is what it's fair value is.

How did you arrive at a R30k capital gain - and who does this capital gain belong to?
Ignore it, but what I meant was if it is impaired to nil. But you would put SARS' head in a terminal spin.