<p>At least sometimes, yes, but not always. Consider a couple of cases:</p>
<ol>
<li><p>If the question was later edited to make it clear, or you conclude your own reading of it was mistaken (so that other people are unlikely to have read it as you did), then I think deletion or wholesale rewriting to address the new understanding of the question are usually reasonable choices.</p>
</li>
<li><p>If the question was, and remains, ambiguous and can be taken two ways -- even if you no longer think that your original interpretation is the correct one (perhaps from reading another answer, say) -- then there can be value in leaving the answer there, because other people looking for help on the question you thought you were answering may put it in a similar way to the posted question. Another alternative would be to retain the original answer and also answer the question as you now think of it (possibly with the original answer coming second), highlighting that there's two possible ways to take the question.</p>
<p>If you do either approach in 2., you may want to add a note at the start of your answer describing your changed view of the question but explaining why the answer is staying there. [Possibly the question should also be put on hold as unclear, but that is not itself a reason to delete the answer.]</p>
</li>
</ol>
