xdg-open is currently unusable for magnet links on desktop environments that rely on the 'gio open' handler (and gvfs-open on gnome 3.24+). Here are a couple bugs for context:
While the second bug is working on a possible fix for the issue in gio-tool itself, it isn't clear that the change is going to be implemented anytime soon, and applications that currently rely on xdg-open for certain URIs such as magnet links are broken. I'm not exactly sure what additional functionality would be lost by just using the generic handler, but at least that one works in this situation where gio is trying to mutate the URI incorrectly.
I can confirm this. I encountered this through http://doc.qt.io/qt-4.8/qdesktopservices.html#openUrl failing. Simply xdg-open fails as well. A strace reveals that gio is used.
Further I have to say that it weird, sometime it works sometimes not. Somehow the filemanager plays a role too. Nemo does not have this problems while nautilus does.
$ strace -f xdg-open "/home/manuel/documents/uni/kurse/ml/Machine learning 2017" 2>&1 | grep execve
execve("/usr/bin/xdg-open", ["xdg-open", "/home/manuel/documents/uni/kurse"...], 0x7ffc1905f720 /* 49 vars */) = 0
[pid 28094] execve("/usr/bin/gio", ["gio", "help", "open"], 0x1948620 /* 49 vars */) = 0
[pid 28095] execve("/usr/bin/gio", ["gio", "open", "/home/manuel/documents/uni/kurse"...], 0x1948620 /* 49 vars */) = 0