I got fed up waiting for Kobo to solve the duplicate shelves problem, especially, after their Customer Service advice was to carry out a factory reset
So I did a quick revision on using and editing databases and following the advice of "davidfor", did a quick edit of SQL. Amazing how much information you forget over the years. Now no more problems of duplicate shelves. Thanks to "davidfor". That is twice now your advice has cleared things up for me.
I just hope that once Kobo pull their finger out and solve the problem on their server sync, this circle doesn't start again