The calibre driver doesn't care how the shelf was created. If the name matches the shelf name in the columns it is configured to use, the shelf will be used without changing it. And it will also delete shelves if it removes all the books from the shelf and the option is set and.
The shelf name has to be an exact match; spelling and case. On the device you can create shelves with leading and trailing spaces and different cases. So, you can have "AAA", "AAA ", "aaa", " AaA" as all different shelves on the device (there is a programmer at Kobo that is lucky I wasn't in the code review). The driver won't match the shelves with leading or trailing spaces, and will only match with the shelf with exactly the same case.