Hi there, I have never heard or met the trouble that the file/folder created and saved to a specific directory goes to the root folder of iCloud. However, some people did tell me that they had encountered such trouble with OneDrive. To shed light on this, you must place all shared folders on the top OneDrive folder, also known as the root folder. As for iCloud, you can place or move the shared folder as you like and it has nothing changed. Based on your trouble, you're recommended to send a report to Apple for a solution directly.
Good luck~