It appears to happen when you breed an already shiny pokemon. The offspring looks shiny but isn't. Evolving it fixes the visual bug.