I have not tested this because I don't want to delete all my photos and I don't have a 2nd set of systems to try this out with, but I think this can be done by creating a "shortcut" to do it. (Shortcuts are like AppleScript for the iOS ecosystem).
To do this, search for the "Shortcuts" app and run it (it usually isn't visible).
- Create a new shortcut - Add the "Find Photos" action - Add the "Delete Photos" action
This should connect the two actions together. You can then run it using the play button.
This will take a very long time to run if you've got a lot of photos and it will ask to confirm using a popup. It might be worth trying to remove items in smaller chunks by using a filter (perhaps based on date or some other criteria).
I hope this helps.