construct POSIX file with variables

This AppleScript code works for me using the latest version of macOS Big Sur.

set filePath to "/tmp/test.txt"
tell application "Finder"
    delete filePath as POSIX file
end tell

This also works for me…

set filePath to POSIX file "/tmp/test.txt"
tell application "Finder"
    delete filePath
end tell