Older desktops don’t follow the specs and xdg-open does different things based on the desktop, so they indeed can get out of sync.
I’d have to look into your specific case but `gio mime` and `gio open` do the right things.