NamespacedLocationFactory has a method:
this method is supposed to return the namespace location plus the given subpath. Instead, it just returns the namespace location. So if you try and get a location then delete it.... you end up deleting the namespace.
Thankfully this isn't called anywhere (at the moment) with a non-null subpath, but it is needs to be fixed asap.