If the black appears randomly I would guess at a mainboard problem. It looks like it is sending the signal to fire the black head instead of the correct one ( or as well as the correct one ). There is no physical reason the printer would do this, and nothing to do with the encoder. The black head is actually printing properly as it is leaving the white text, but not when it is supposed to.
It could be a short or issue with the transistors, but I suspect the main chip is failing and the only option for this is to replace the board