I have made the changes and uploaded a beta version. The reason it is a beta is that it also has the changes needed for the Qt5 version of calibre that is in beta. The plugin will work with the released version of calibre. I am not quite ready to release this, so pleas download it from
https://www.mobileread.com/forums/showthread.php?p=2875183.
The change I have made for this problem is to use "(Unnamed shelf)" as the name of the shelf when there is no name. If there are duplicated shelves like this, they will not be removed. If that is needed, I will need to look into what is happening to cause this.