@Ivan That happens probably, because you didn't provide the right filetype when asking for the default application. Important is how xdg calls that specific file-type. This can easily be found out by running
xdg-mime query filetype example.png
As an example, if I do this with a specific png-file on my computer it returns
image/x-apple-ios-png. Once you have the actual file type figured out, you can run
xdg-mime query default <new filetype>
and get the application that is used by xdg for this specific file type. In case no application is defined for this filetype, xdg-open checks if the file
/etc/debian_version is available, if this is the case, it will launch
run-mailcap, which is very similar to xdg-open and tries to find a program to open the file as well.
Only if this fails too, xdg-open will ask the user to define a program to open the file.