If, during battle with another trainer, you accidentally kill the Shadow Pokémon, simply leave the area and return. The trainer will want to fight again, giving you a second chance to catch the Shadow beast!