Ah, now that we know what you want to accomplish, a better and different solution appears possible:
Add .nosync (don't miss the dot there) to the end of a file or folder name to prevent syncing over iCloud Drive.
https://discussions.apple.com/thread/8137146
That is much better than hiding something and having to toggle invisibility all the time. However, it is used in that linked context to stop a Mac folder from syncing to iCloud and not the other way around so I don't know if it works in reverse too. Realize that iCloud isn't really intended to be used as a hard drive in the sky, it is syncing storage so you are trying to work against its fundamental design. For what you want to do, Dropbox or a pure cloud storage solution may be better.