Xdg-open URL returns user-open error

I want to open URLs from a snap with xdg-open, and so I added the “desktop” interface. Now I get this message when trying to open a link from a shell script inside the snap: user-open error: Object does not implement the interface.

EDIT: it suddenly started working with no modifications…