How to delete photos in iCloud?

I have a vault on a NAS which has all my originals. I have Mylio on two computers (PC and Mac) and on my iPhone. Apple Photos on my Mac downloads original from iCloud, which Mylio then syncs to my vault, and Mylio on my iPhone does not have access to Photos, to avoid duplicates.

When I delete a photo in Photos on my iPhone, Mylio will detect this and ask me if I want to apply the change. I press the Apply Changes button. However, the photo I deleted from iCloud on my iPhone does not get deleted in Mylio. Apply changes does not seem to do anything. I’ve tried this with Safe Delete bot on and off. Same behavior; changes were detected, I press Apply Changes, but the photo remains.

Isn’t this supposed to work? If not, how can I make this work? I don’t want to delete photos twice, once in Mylio and once in Apple Photos, and I don’t trust Mylio enough to turn off iCloud photo syncing.

I tried to understand your setup, but you lost me at “delete iPhone pictures, and Mylio detects the difference”.

I thought Mylio on iPhone has no access to the photos in order to avoid duplicates?

The Mylio library and the iCloud library are two separate entities, so if you import pictures only on the Mac (where iCloud sync and Mylio sync interconnect), you inevitably will end up having to delete pictures twice, if it was already synced.

I handled it pretty much like this, until I stopped using iCloud sync altogether. My devices now only sync via Mylio and every device is enabled to import pictures into Mylio. Except for the getting started phase, I also had no syncing trouble with Mylio, seems pretty robust.

When I delete a photo in Photos on my iPhone, it is deleted from iCloud and thus deleted from Apple photos on my Mac, which is a source folder for Mylio. It doesn’t matter whether I delete from my iPhone or from Photos on my Mac, the point is it gets deleted from a Mylio source folder.
When I delete a photo from my other source folder (scanned photos, old photos etc.), photos actually do get removed from Mylio on all devices. Why is the Apple Photos source folder special? Why doesn’t ‘Apply Changes’ do anything?

Apple photos on my Mac, which is a source folder for Mylio

Uh-oh! That sounds like you added the Photos-Library as a source folder, but this library is a package and not just a regular folder.
This may be the cause for Mylio handling this folder differently, because it probably has no full access to it, because the package file is owned by Apple

I followed the official directions and also gave Mylio full access to Apple Photos. It’s ok with me if Mylio can’t/won’t delete from Apple Photos, but I would expect it to work the other way round, i.e. if a photo is deleted from Apple Photos source folder, Mylio will accept this change.
From the linked page; “Changes made within Photos post-import will be reflected in Mylio automatically. This includes edits.” Deletion is a change. Mylio indeed does notice the change, but does nothing when I want to apply it.

Just to clarify, I want to keep using iCloud as an online back-up, but also as a way to propagate photos to Mylio. Without iCloud I will have to open Mylio on my iPhone, keep it open until it is done syncing, and this has to be done every time I take a photo - all the photos I take without opening Mylio will be lost if I lose/break my phone. With iCloud photos are backed-up to the cloud almost instantaneously, and synced to Mylio, my on-site back-up, moments later (or if my Mac is off, whenever I turn it on).

iCloud ensures the safety of my photos and thus I don’t want to turn it off.