I think the approach is wrong. If you have a Nextcloud, then all you really need is a regular backup and files that you no longer need in the Nextcloud can simply be moved to the trash because you have got a backup. If you have different backup generations, you can always go back to other times. What you describe will go wrong at some point. Then you might as well leave it alone.
Do you have ssh/sftp-access to Nextcloud? Then you can delete the files and afterwards you can occ files:scan --all. But not very nice.
You describe things where it is better to do without Nextcloud altogether and use normal web storage, for example. Maybe you like Tiny File Manager instead with ssh/sftp.