Deleting an ubiquity container = giant mess?

TL;DR: Does Apple keep a list of ubiquity containers that a user has deleted, and prevent apps from creating the same ubiquity containers again?

If so, where is this list, and how can I reset it?

Long version:

I'm developing an app that relies on having an ubiquity container (iCloud Drive folder). This was working fine until I decided to rename the folder.

I deleted the existing folder with the old name, changed the value of "NSUbiquitousContainerName," and expected my app's code to create the new folder with the new name, as it had done originally.

But the result has been a disaster.

Now, in the simulator, all of my code is running without errors. The app thinks the iCloud Drive folder exists and can read and write files to it, but the folder only seems to exist in the simulator and is not visible via any iCloud Drive UI.

When I run the exact same code on my iPhone, the code fails with the error 'You don’t have permission to save the file “Documents” in the folder “[whatever]”.'

I have tried changing my app's bundle identifier and everything works swimmingly: the iCloud Drive folder is created instantly and is visible everywhere.

So something is preventing things from working with the original bundle identifier and I need to figure out what it is and how to fix it. Does anybody have any ideas? Thanks in advance.

Deleting an ubiquity container = giant mess?
 
 
Q