Visio has that nasty feature that when you delete a layer it deletes the shapes assigned to this layer as well.Whilst the UI gives you no option to deactivate this feature, VBA does: https://docs.microsoft.com/en-us/office/vba/api/visio.layer.delete
I've discovered this possibility after years of de-assigning my shapes from the layer before deleting it and thought I'd share.