In fact it simply guarantees the problem will happen.
Awhile back the decision was made to no longer allow the Delete key to delete layers the layer panel - the purported reason being that it was possible to accidentally delete an object or objects that was currently selected in the main Rhino window. There was a fair amount of discussion and protests at the time, but the decision was maintained. That ounce of prevention is now worth a pound of… (fill in your own description)
So now, if one or more objects are selected in the Rhino window and one goes into the layers panel, selects a layer and hits the Delete key - which is a natural reflex to do, virtually all other programs with layers work this way - the layer is not deleted, but it is now CERTAIN that any objects that happen to be currently selected in the Rhino window WILL BE DELETED.
Good job in solving the “problem”.