In commit 4969367ac7668a857dd5d03a9db7beb9ae3b667f, the two moving triangles should presumably be in the opposite order depth-wise. They are equally big, but one is further away than the other, so it seems that the smaller one should be behind the larger one.
I'm not sure there's a bug. There was a mistake in setting up the test scene, which may have produced these unexpected results. Seems to work okay in commit 52279e4d90e8423c61fb7aa0f369d89efbab0561.
In commit 4969367ac7668a857dd5d03a9db7beb9ae3b667f, the two moving triangles should presumably be in the opposite order depth-wise. They are equally big, but one is further away than the other, so it seems that the smaller one should be behind the larger one.