Most/all C++ based IO code had a pattern of doing if (!RNA_struct_property_is_set(op->ptr, "filepath")) { /* set default path */ }. However, RNA_struct_property_is_set returns false for properties restored from "previous operator settings" (property restoration code sets IDP_FLAG_GHOST flag on them, which "is set" sees and goes "nope, not set").
The fix here is to apply similar logic as 10 years ago in the T32855 fix (rBdb250a4): use RNA_struct_property_is_set_ex instead.
Open question: the "check if file path is set, set default path that's based on blender file location" seems to be pretty much copy-pasta just with different extension between all these places. Maybe worth factoring it out into a common shared function?