Aha, so within the shortcut, it’s all “virtual” modifications, and you need to explicitly save the file (which results in a new/duplicate file). And since it’s in Shortcuts, it has to be saved within the Shortcuts folder if you want to save to iCloud Drive.
So my next question would be: can I pull the folder path from the existing file to auto-populate the /Shortcuts folder path? I’m using this as a Share Sheet action, so there is no Get File action step in the Shortcut to reference.
I think the way Shortcuts receives the file is just as a copy, like an attachment to an e-mail. Imagine a file that is shared in through the identical share sheet mechanism from an e-mail app. The e-mail app could be storing that file in a database. It may save it to a temporary file at the point of exporting, but in no way is any information about the original ‘file’ location being sent, nor would it be meaningful unless Shortcuts also knew how to directly interact with he data structures in that particular database.
I can’t see a way you would unless you had a list of files that had that name and location, or searched for a match. Now that latter pointI guess would technically be possible utilising Scriptable to traverse the iCloud folder structure, but I suspect it would be inefficient.
Maybe pass the file into the shortcut, have the shortcut rename it and copy that name to the clipboard, then put you in Files, and then you manually rename the file utilising the clipboard. Cumbersome I know, but I’m just trying to think of anything that might help