Turn off the power, work out what's behind the wall, then refit the switch with the right fixing and test it.
Part P of the Building Regulations covers electrical safety in England. A like-for-like switch refix isn't notifiable, but special rules on positioning near water apply in bathrooms.
Some links may earn us a small commission at no extra cost to you.
Save this as a project