To fix the code, I put a 0.3 second delay before the colors started switching to let the yellow ball have time to appear.