When someone uses a command via DM with the bot, it is not able to use the guild object associated with the interaction. This was discovered when someone tried to register via DM with the bot instead of in a chat channel on the server. See in particular set_role within registration.py.