I keep having issues with iCloud syncing recently. It’s probably my fault, because I also have Syncthing working with the same folder, so I can sync files from my iPhone and my Mac to my Android and Linux machines. It used to work OK, but I just lost a chunk of information that was important.
With Syncthing, I have an option to turn file version history on. With iCloud, I’m not sure if that’s possible. I can use Synctrain (a syncthing client for iOS), and I hope this will resolve the issue.