My lighting socket is hanging out from the wall and I suspect it is due to a thick layer of paint blocking the sides from clicking in. Is this fixable?
If it is indeed the paint that's causing the stand-off, it would suffice to remove the paint.
If the stand-off is between base and wall:
With a utility knife and fresh sharp blade cut into the wall at the outline of the switch base. This scores the wall paint and prevents uncontrolled chipping in the next step: then, position the blade at an angle and carefully pry off the paint in the area covered by the switch ("under" the switch cover).
To avoid accidental damage to wires, let the blade extrude only 1..2mm from the knife.
If the stand-off is between base and switch: pry off the paint with a knife. Score it to make it easy to crack, and then pry it off in small sections.
Also make sure all threads in screw holes are clear of any paint.
If this is not the problem you meant, kindly provide more details in the question.