I just had a series of facepalms as a result of attempting to completely automate my silk farm. My silk farms are bi-directional - the spider shoots one way, while webs are collected from the other. When ready, I simply had to flip a lever to switch direction. I was looking to automate this by means of a water reservoir repeatedly filling and draining - the idea was that when the tank reaches half-full, the spider would be webbing to the west and my dwarfs collect from the east. Then, when the tank reaches half-empty they would swap sides.
Facepalm number one: When I tested the pressure plate that should have triggered the switch from west to east, it didn't work. At all. Still, I had just moments before the test made the switch with the pre-existing manual lever, so I figured that the commands where sent too close to one another and the gates got confused.
Facepalm number two: One of the pressure plates was too sensitive - it had to wait for the last bit of water to evaporate, and so a floodgate was locked open. This had the result of essentially causing the system to flail out of control, pouring water in more or less randomly. Easy enough to fix, just replace the pressure plate with one with a higher minimum setting.
Facepalm number three: In the process of attaching the faulty floodgate to the new pressure plate, I found I had neglected to put in a manual cut-off system, which left the jammed-open floodgate in the middle of a high-pressure water flow. Trying to time the mechanic's reattachment procedure with the random switching of the raising bridge upstream failed, and accidentally flooded half of the access ways to the system. Luckily, I was able to install some doors to keep most of my fort dry.
Facepalm number four: During the brainstorm to figure out how to get into the floodgate despite the high-pressure water flowing past it I realised that I could have made the design slightly more efficient. I decided that I wasn't even gonna bother streamlining the design, coz here on DF we're all about unnecessary complexity.
Finally, by installing a cutoff downstream, I managed to lock the randomly-opening bridge in the upright position, thus allowing access to the floodgate. Which led to...
Facepalm number five: The floodgate was still up, and I had no way of actually getting it to close. Again, a simple fix. I replaced it with a fresh new floodgate.
Finally, the thing was filling and draining properly! Yay!
Facepalm number six: The mid-reservoir floodgate has the exact same sensitivity issue as the first faulty one. Grr! Fortunately, I already had a system of drawbridges to let me at that particular plate, so repairs should be quite simple. In theory. Maybe.
Facepalm number seven: I already deconstructed the manual lever, which would have made repairs simple. I'm gonna have to get creative now.
Edit:
Facepalm number eight: Somewhere during this whole debacle, the autosave kicked in. "Dammit!" says I, "I could have loaded from before I stuffed the thing up and built it right! I never even thought of that. Now it's too late!" because I don't back up my saves. Still, this is DF, where the difference between an excellent design aesthetic and a royal cock-up is entirely dependent on your point of view.