Why my documents are empty sometimes
That’s because sometimes iCloud will move the contents to remove server, this is totally controlled by the system, and will be there once the document is downloaded by iCloud. You can check your documents from “Files” app.
do I need to pay to get iCloud sync?
No, iCloud sync is integrated and free to use