(Providing an additional answer, long after the fact)
The question here asked about fixing a puzzle that was unintentionally much harder than originally intended. I'm going to extend this answer to cover additional types of mistakes made by puzzle setters, as much of the advice given both here and elsewhere is applicable to many types of problems with puzzle postings.
Let's address the simple cases here first.
If your puzzle has no answers, and you've discovered an error in its details, formulation, or difficulty: fix it before someone posts an answer that incorporates (or worse yet, relies on) the error.
@leoll2's answer basically says exactly this, suggesting fixing the problem as quickly as possible, or if you can't fix it immediately, adding a note disclosing the issue; you might also want to delete the question until it can be fixed (or permanently if no fix is feasible).
That is: Own the mistake, correct it and apologise if you can fix it; Delete the question if you can't.
If your puzzle has no answers and gets closed because it's too broad, is primarily opinion-based, is unclear, or invites subjective or speculative answers: again, fix it — hopefully, people have left comments indicating what is wrong with the puzzle, which you can and should take in the helpful spirit in which they were offered. The community here generally wants to help its members become better puzzle creators, so please heed any advice you're given as it will help you improve your puzzle. Once you believe you have fixed the issues with the puzzle, you can vote to reopen it, and others will help determine if the issues are now corrected. If you have questions along the way, or if an attempt to reopen is rejected, you too can use the comments to ask for further assistance in fixing what needs to be fixed.
But my puzzle has one or more answers now!
Well, now things get trickier. For one thing, you probably can't delete it any more, so you can't just take it off the table until you fix whatever's wrong with it. More importantly, now you have people who have submitted answers for a puzzle that has something wrong with it; if you edit the puzzle, their answers may already incorporate (or worse yet, rely on) the error(s) in the original version.
Since this question was asked, we've largely established that it is poor form to change a puzzle so substantially through edits and clarifications that existing answers could be invalidated. That can result in existing answers no longer meeting the criteria of the puzzle and/or referring to parts of the puzzle that have changed or disappeared, which can (and does) lead to later visitors downvoting answers made before question edits/clarifications as being entirely incorrect. This is why we tell puzzle setters NOT to do that. For example, my usual comment to someone seeking to make a significant edit to a puzzle goes something like:
Changing your question after you've received answers is inappropriate, as it invalidates the answers you've received. It can even make those answers wrong, and adversely affect the reputation of those who answered. If you now have a new or additional question, create a new post and ask it there; you can link back to this one if needed for reference.
It is manifestly unfair to leave answers made prior to invalidating edits subject to downvotes by people unfamiliar with the history of the question, if the answer was a fitting answer to the question as it stood at the time the answer was made. For that reason, we strongly discourage such edits.
We never want answers made in good faith prior to an edit to be downvoted if made invalid by that edit.
But I really want to fix my puzzle!
There are three common cases where a puzzle setter might want to make major updates to a puzzle after it has already received one or more (possibly partial) answers:
Problems with how the puzzle is written or presented that make it too broad.
This is probably the most common scenario we see.
Such puzzles are often so loosely written that people start offering a wide range of answers that technically fit the question just to show how excessively broad it is written, with no rational expectation that the answer they're providing might be correct—these are not "answers made in good faith" and shouldn't expect immunity from downvotes. If made, such answers should be deleted by their posters once the issue they were posted to highlight has been addressed.
See in particular the Note to solvers found near the bottom of this answer to the relevant related question, If a puzzle appears to be too broad, should one change it if answers are already posted?
However, sometimes the proffered answer to the question as posed is as good as, if not better than, the intended answer, and would be a very reasonable answer but for subsequent editing that invalidated it. It's this scenario we want to avoid.
Problems with how the puzzle is written or presented that make it unclear what is being asked, or primarily opinion based, or sufficiently under-defined that it is subjective and/or may invite answers which are not demonstrably correct, or are otherwise speculative.
These types of puzzles don't really lend themselves well to the usual puzzle-solving process; instead they get speculative answers that try to guess at what the question even means, or provide possible or perhaps even likely solutions that nevertheless are not actually supported by what's in the puzzle as written. These are often broken as designed, and difficult or impossible to salvage without a pretty significant rewrite.
Having said that, the fundamental issue with such puzzles is usually quite apparent from the outset. Someone who answers a puzzle in this state should already be well aware that they're providing an answer that lacks firm footing. It's best not to answer such questions at all.
An actual error in the puzzle itself.
This is usually an issue discovered fairly late in the process, where the poster discovers (often because a solver reaches an unexpected result or dead-end) that some detail was left out or stated incorrectly, leading to an incorrect interim result that renders the puzzle unsolvable as it stands.
It hopefully has not escaped your notice that the first two common cases, not at all coincidentally, mirror our close reasons. If there are pretty clear issues with a question, answering it anyway is not the best option. To repeat part of the aforementioned Note to solvers:
[...] Much better would be to try to help the poster recognize the issues with their puzzles via constructive comments, and to vote to close until those issues are satisfactorily resolved.
Closing a puzzle is not a punishment - it's the best mechanism we as a community have available to us to prevent people spending time and effort on a flawed puzzle that is likely to either be substantially edited, or (perhaps eventually) deleted. It's meant to help the poser refine their question so that it can be solved the way they intended. Use it, please!
But close-voters should not just slap on a close-vote and move along. Comments are specifically there to let people "Request clarification from the author" and to "Leave constructive criticism that guides the author in improving the post"—and many of them do. If your question has been closed, heed those comments! See also the information near the top of this answer regarding closed questions.
(And if you're the one voting to close a question, please comment accordingly, if nobody else has already elaborated on the issues you're voting for closure about!)
What did any of that have to do with fixing my broken puzzle ?!
Hang on, we're getting there. So we've noted that ideally,
• flawed questions get closed before they get answers, and
• questions that have answers, don't get invaliding edits.
But of course both of those things happen routinely, as this is far from an ideal world. Now what?
Indulge me; let's look again at this answer, but this time in its entirety. Because, in answering the question If a puzzle appears to be too broad, should one change it if answers are already posted?, it doesn't just say "No". After saying much of what I've said here about Why you shouldn't change a question with answers, it goes on to say:
One of the very real purposes for comments is to suggest ways to improve a question—to ask for information that would be needed to provide a better answer, or to suggest ways to make the question more clear or more useful to other visitors. And edits can be made, or at least suggested, by anyone. That questions may change is part of the model here [....]
In other words, nobody is saying one should never ever change a question just because doing so might affect answers that have already been posted.
So when is it okay?
A lot of us are here because we are fans of puzzles, puzzle-solving, and puzzle-creation, and this is a great community in which we can try to improve our puzzling skills. Insisting that every puzzle be perfect when posted is unrealistic, and as mentioned, isn't really even within the spirit let alone the letter of the "rules" on how Stack Exchange works.
So, while (ideally) we put up fences to keep flawed puzzles from being answered, and keep reasonable answers from being invalidated, we have to face the reality that it's going to happen. But we need to minimize the collateral damage—to both puzzle setter and early answerers.
That answer goes on to describe, for the benefit of puzzle setters, what they need to consider before deciding to make a salvaging edit. The key factor, as it points out, is to keep in mind that
Ultimately, it's a balancing act between being fair to both the puzzle and its solvers by making the puzzle actually solvable as intended, and being fair to both the existing answers and their writers by not turning them into so much wasted effort.
Ok great, let's minimize the collateral damage!
Oh, good, we're on the same page. Let's do that!
For puzzles posted with an actual error:
It's usually the case that the answerer(s) would like to see the puzzle through to its complete solution so their efforts thus far are not in vain. In other words, both setter and answerer(s) are invested in the puzzle and will work with each other to see it through to its solution, provided the fix for the error isn't so extensive as to invalidate most of what's been done.
Setters should see the other answers on this page, and own the mistake, correct it and apologise.
Answerers will hopefully update their solutions, or—if they abandon the puzzle due to the setback caused by the error—ideally should note their solution is wrong/incomplete because the puzzle changed.
For puzzles that are too broad, unclear, opinion-based, subjective, and/or speculative:
Unless repaired, these should be closed; these tend to draw downvotes anyway, and a salvaging edit may not even be worth doing unless it's done quickly. Of course these are also the cases most likely to benefit from requests for clarification or from suggestions for improvement, and often can be better defined to fix their issues, but at the potential expense of invalidating early answers.
Setters should be aware they may get downvotes for fixing their puzzle, and pre-fix downvotes may not be reversed—being careful in writing puzzles is important!—but hopefully they'll see new upvotes too.
Answerers who posted just to point out the flaw should update or delete their non-solutions, their purpose having been served. Those who posted good-faith answers to the original puzzle may wish now to update their answer, or if they still feel it's a good answer, may want to add a note to it to indicate why it no longer matches the question as well (or at all).
IN ALL CASES -
The setter needs to bear the burden for their puzzle's flaws!
See in particular Can something be done about the modification of questions and its accepted answer, which notes that
Questions should not usually be radically altered after posting, other than to correct outright errors.
That's a stronger position than it seems like I've taken in this post, but—for questions that have already received good-faith answers, it's exactly the right position to take. Own the mistake means if you change the puzzle, you don't just leave it to your answerers to update their answers or risk downvotes. Indeed, that answer rightly goes on to state that if a substantive change is made to a question, the edit should also include an explicit notice that the question has changed, thus providing an explanation as to why "answers fail to match the question through no fault of their authors."
What if I decide I can't salvage my puzzle without doing more harm than good?
That, of course, is your call.
If you can still delete it, you may choose to do that.
Puzzles with answers generally cannot be deleted (as that would be unfair to the would-be solvers who spent their time and effort trying to solve your puzzle).
In this question, Unanswered puzzle - leave, self-answer or write a postmortem?, the poster asks about some options for dealing with a puzzle where, by their own admission, they "have horribly botched its execution." The two answers to that post suggest a self-answer is a good option, depending on what you hope to accomplish by addressing the puzzle and its flaws. The accepted answer observes that a self-answer with some explanation of the hints and the solution can give the puzzle some closure (and discusses some potential benefits and drawbacks to this approach). The first posted answer notes, "How much you explain about the puzzle and your mistakes is up to you and what you hope to achieve from the process."
Full disclosure: the extensively quoted and referenced answer is my own, as is the accepted answer to the "Unanswered puzzle" question. Despite my having written them, they're still both pretty good answers, so I drew heavily from them. :)