The red one in the picture is mushroom. Fungia look like plate with tenacles when it open, they prefer sand bed placement, if you put fungia on rick it can move and fall on the sand up side down and die.
Yes they can detach it self and float around until they stick to another spot. Yours are might have shrink up and will open again when they adjust to new environment. Mushrooms mostly very hardy coral, unless your water are out of whack and they melted.
A lot of people have little cups or small trays set up in a low low flow area of their tanks with small rock rubble in it ,, they place the mushroom in the tray until it reattaches to a rubble piece ,, then they can mount it where they want ,, this is a low flow coral ,,
If you reattach to a rubble piece ,, then mount it back into a high flow area ,, it will let loose again ,, this is a low flow coral ,, do a search on mushrooms on You Tube ,, You Tube is great for learning about corals don't try to glue it ,,