construct POSIX file with variables
This AppleScript code works for me using the latest version of macOS Big Sur.
set filePath to &quot;/tmp/test.txt&quot;
tell application &quot;Finder&quot;
    delete filePath as POSIX file
end tell

This also works for me…
set filePath to POSIX file &quot;/tmp/test.txt&quot;
tell application &quot;Finder&quot;
    delete filePath
end tell