Here's why:
* Shiny Pokémon are determined at the time of egg creation, not when the egg hatches.
* Catching a Gyarados doesn't influence the odds of getting a shiny Magikarp from eggs. The shiny rate for Magikarp is the same regardless of whether you have a Gyarados or not.
* Shiny Pokémon have a very low chance of appearing naturally. The odds are 1/4096, or roughly 0.02%.
While breeding a Magikarp with Ditto is a great way to get a large number of Magikarp quickly, it won't directly increase your chances of getting a shiny. You'll still need to rely on luck and hope you encounter that incredibly rare shiny!