Bad idea because the cable for a light switch is pretty certain to run directly upwards from it.
"Safe zones" for electricians to run cables are, among others, horizontally and vertically from accessories such as switches and sockets, on the grounds that no sensible person would put a nail or screw into them.
Because the light, and the circuit, will be in ths ceiling above, it would be abnormal for a light switch cable to go anywhere other than upwards, though there are some eccentric people around. Put the hive to the side of the switch, even if (for the moment) it will be glued on.
It is reassuring to unscrew the accessory and see which way the cable comes into the backbox.