I thought with this for years. It's unreliable and buggy on Android and iPhone. I caved and paid for some photo sync app and it's been super stable.
That or folder sync on Android. Then feed into immich or photosphere.
I spent many nights running diff and comparing sources and destinations and md5sums and so on