Make sure to set your Obsidian folder to "Keep downloaded" on iCloud for every device. Otherwise iCloud automatically deletes files locally to save space on your device.
It's a terrible default and Apple doesn't provide any way for developers to detect if it's off.