Preface: this question is already asked here but user gave up and gave solution to first answer. This question also differs in that I have two similar collection structures,
I was able to fix this bug, the accepted answer currently only explains the why and does not provide a fix. Here is the code that caused the bug (for me) when I attempted to run this without a "users" collection at the root of my Firestore:
db.collection("users").document(currentUserUID).collection("groups").addDocument(data: [
"groupID": newGroup.documentID,
"userAddDate": NSDate()
])
The currentUserUID document that was created was throwing the 'Document does not exist' virtual bug. I copied the currentUserUID and deleted the users collection and virtual UserUID document.
I then created a new 'users' collection at the root node and pasted in the value I had copied for the userUID with a bogus field.
Then when I re-ran the above snippet of code, the "groups" collection and document were re-added no problem :)