Don’t worry, you won’t lose your shiny. Finding a shiny Ditto is just the luck of the draw. Any Ditto you find and catch has a chance to be shiny, and the shiny rates are higher than usual.