Answer:
r = len(A) -1 # needs to be inside the for x ... loop
Step-by-step explanation:
After appending a result sum to your output list, your value of r remains at its last value. In the case of {-6, 0, 6}, you miss this because r is pointing to "5" after having just located the triple {-8, 3, 5}.
When "left" is reset for a new value of x, "r" needs to be reset, too.
_____
Comment on the algorithm
You have an interesting algorithm here. When written as a procedure in Mathematica, it executes your example problem in 280 us. A less procedural approach that generates all subsets of length 3, then sums those, then picks the ones that have a sum of zero executes in 120 us. Of course, keeping lists of all subsets and their sums uses a lot more memory than your program does.