I made an app that uploads images from the Shared storage scope to Google Photos. This works. I added a mode that deletes uploaded images. This also works, the images are no longer visible in either the Gallery or in the Files app. However, running ListDirectory still includes deleted entries. I tested this in the companion and in a built APK that was installed for the first time after the files were deleted, so if there's some kind of cache it's not specific to one app. I am running Android 8.1. The app requires logging in to an OAuth page that's not open to others so sharing the aia would not be useful. The code is just a ListDirectory block like this:
I can reproduce even just using the Do It menu with that block.