Items that have been enchanted with Curse of Vanishing are doomed to disappear, unless a player takes extraordinary precautions to prevent it.
If a Minecraft player is about to die, the best thing for them to do is throw the piece of gear with Curse of Vanishing on the ground manually. Even if the player dies, the piece of gear will still be there for players to retrieve.
One of the best methods that Minecraft players can use is to store their items with Curse of Vanishing in a shulker box.
Further information available about at https://www.mygamesetup.com/what-the-curse-of-vanishing-does-in-minecraft/