There is 2 ways to fix this that I know of:
Vigorously shake your mouse while holding the object,
Rotate the object out of the wall. (Neither of these work 100% tho)