By sorting on key
x == 0
we are sorting two values; True and False. True is greater than False so they appear to the right. The other numbers don't change order because timsort is a stable sort.