In Pokemon Legends: Z-A, every-time you find a shiny, it will never despawn with another Pokémon until you catch it until you got 10 shinies that you didn’t catch, in that case the first shiny you catch will despawn. This is a new mechanic introduced in Pokemon Legends: Z-A. If you close the game, change the time or leave the area, it will not despawn unless you didn’t save.