How do I force macOS to always save file extension?
Apparently this is the way Firefox handles the "Save as..." action. When using Chrome or Safari there is no issue.
There is a bug report since 2008, but the status is still 'NEW'.
The only solution I see at the moment is to select the name (unnamed.png) and only edit that part in the text area.
You can hide common filename extensions, so in the save dialog no filename extension will be shown.
In a finder window, open preferences from Finder
menu. Uncheck Show all filename extensions
.