Example: Say I'm about to battle Zekrom in N's castle, and when I battle it, and it's a shiny. Is that considered to be a rare chance, or it it considered a glitch?
You can never have a Shiny Zekrom in N's castle, first of all.
So, if you meet a legendary that is Shiny (most of the time) you've got a rare chance!