When clicking a downloaded file in the list of downloaded files Firefox will use the first program listed in the line
application/pdf=of the file
usr/share/applications/mimeinfo.cache, which is set not by the default/system settings for that file-type (e.g: the default application for pdf was Okular, but that line was
application/pdf=inkscape.desktop;okularApplication_pdf.desktop;, so that Firefox opened the files in Inskape instead of the default Okular.)
A solution is to modify that line or, even better (because that would not be overridden by other newly installed applications) to create a per-user file
~/.local/share/applications/mimeinfo.cachewith lines like (example for pdf):
The disadvantage of the above is that it is a per-file-type setting. To have a solution for all files, use the first commands posted above.
In case that stops working, be sure "Always ask" is selected under `about:preferences` in Firefox and then re-do the steps above.
A more radical change would be to remove the undesired application and/or reinstall the desired application (last installed takes over).