Simple lever puzzles are ok, even in the main quest. Advanced ones in the main quest only if it's possible to somehow declare a defeat and still be able to continue. A GM tends to be adaptive and helpful when a party is completely stuck, and come up with alternative approaches. This could also apply to the game. I.e. "Do the puzzle to eliminate some crystal power effect". If that fails and you admit your failure, you may after some delay (the quest giver might have to come up with an alternative way) get the quest to "Ok, go clear the 6 dungeons that feeds the crystals", but may involve more fighting than thinking, and take additional time. So it is both a punishment and a reward at the same time.