Mushrooms will detach from stress, poor water conditions, not enough lighting/flow or too much lighting/flow. Nothing to be overly worried about. You could, as hinds said, use a rubberband to hold it in place. Or even let in float around until it lands in a spot and if it likes it it will reattach. I could be wrong but I seem to remember stories of people using womens stockings to hold them in place. Might wanna research that one before trying it haha. Good luck