When you are repairing the mine shack, the wood pieces are moved by clicking and dragging. Grab a piece and pull it in the opposite direction to the way you want the mechanism to turn.
Keep going until the metal component has rotated to face the other way. That is the state the puzzle is checking for, and the beam will not budge properly until it is aligned.
Drag in a single smooth motion rather than a series of small tugs. The game registers the drag distance, and short movements often get interpreted as a click instead.
If the pieces snap back, you have almost certainly rotated the wrong element. Reset and work on the metal piece first, then the wood around it.