Applescript problems with renaming a file and getting the alias to change it's name as well
I think that got broken somewhere, as an alias is supposed to be a reference to a file item that remains valid even if it gets renamed or moved.  If you are going to be using POSIX paths anyway, you might take a look at using Cocoa's NSURL class (via some AppleScriptObjC) to keep track of the file references, since that is ultimately what is getting used (or is supposed to be used).

use AppleScript version "2.4" -- Yosemite (10.10) or later
use framework "Foundation"
use scripting additions

tell application "Finder" -- get the selection
    set theSelection to selection
    set theFiles to the files of (first item of theSelection) as alias list
end tell

repeat with anItem in theFiles
    set anItem to POSIX path of anItem
    set fileRefURL to (current application's NSURL's fileURLWithPath:anItem)'s fileReferenceURL() -- get file reference from path
    tell application "System Events" to set the name of disk item anItem to "temp_" &amp; (name of disk item anItem)
    set posixPath to (fileRefURL's |path|()) as text -- get path from file reference
    display dialog "Before:" &amp; return &amp; anItem &amp; return &amp; return &amp; "After:" &amp; return &amp; posixPath buttons {"Cancel", "OK"} default button "OK"
end repeat