'Position is not a valid member of Folder...' from core script

Basically, I have a system that switches the main dialog in a part by putting the unnecessary dialogs in a folder. When I answer the dialog that switches the main dialog, this error pops up. What’s causing it and how do I stop it? (I couldn’t find anything that helped with this elsewhere)
(I’m sorry if this is the wrong place to ask this, I’m not sure where I’m supposed to)

Solution:
I think that this error has something to due with the dialog disappearing before the chat bubble has time to disappear. I just put a task.wait(3) where it switches the dialog and I’m no longer getting the error.