To find the missing part of the mechanism go out of the room with the door in it through the door to the right. Keep going straight ahead (don’t go into the cave to the right) until you find another mechanism on the wall to the right:
Take the lever from it and go back to the mechanism next to the door.