LAST_DOWNLOADED_FILE_NAME not working in Firefox or Chromium

The ${!Last_Downloaded_File_Name} value is only known after the download. So at onDownload - which you need to use before the download is triggered - it can not be used.

${!Last_Downloaded_File_Name} is for example useful if you want to pass the name of the new file to an external XRUN script.

See also How to Rename a file by adding suffix to existing filename in other words how to get the downloaded filename