Renaming files with a RegEx search, preferably via JXA
The Path object is a very basic structure and doesn't provide any actual filesystem functionality. Instead, use System Events:
theFile = Application("System Events").aliases.byName("~/Desktop/1234-12a-test.png");
theFile.name = "thisDoesWork.png"