Yes, you are right. And thanks to you, I found this fact:

Whatever input string is, result[0] never changes.

To prove that, thinking about all possible situations, and there are ONLY two cases:

It never been hit because we already found the result and returned it when checking previous digits; (e.g.: 21:39 -> 22:11, the first 2 is not touched.)
We do need to check this digit, which means that we replace all three previous digits with digits[0]. This situation happens if and only if result[0] == digits[0]. Transparently there is no need to change it as the result is guaranteed the same. (e.g.: 19:59 -> 11:11)

And it also explains why the typo doesn't lead to a wrong answer. I've fixed it and updated my explaination accordingly. Thank you for pointing it out! : )