Use the Finder to act on a path, via JXA
It's quite odd that Finder would expose no method of converting a Path to a Finder file object, yet one doesn't appear to exist. Instead, it seems (per this question) that System Events' aliases property is the only way to convert a path string to a Finder object, like so:
file = Application('System Events').aliases['/some/file/path']
console.log(file.name()) // --&gt; 'path'
file.name = 'newname'

Finder does allow you to manually drill down through the file hierarchy (see this answer), but it's a pain:
file = Application('Finder').startupDisk.folders['some'].folders['file'].documentFiles['path']
console.log(file.name()) // --&gt; 'path'
file.name = 'newname'

However, only some of the attributes these objects are supposed to expose are actually working for me on Big Sur. (Reading and writing comments, for instance, does not seem to work.) If you need reliable and robust Finder scripting, JXA simply may not be the way to go.