Option: don't delete but add a disclaimer
If I feel that an answer is not great but still useful, (and sometimes even a wrong approach can be useful as we can learn from errors), then I leave the question undeleted with some disclaimer at the beginning.
Confused about the notion of overfitting and noisy target function https://stats.stackexchange.com/a/625733/
Edit: Watching the video further, I see that they meant something else. I leave my answer anyway as a useful answer for people that land on this question and have a different interpretation of the question...
Here I had a different interpretation but the answer is still useful as an approach to the different case. Since more people than only the original poster may have the same question, it can be useful to leave the answer for them.
Fitting an Orthogonal Grid to Noisy Points https://stats.stackexchange.com/a/581290/
This answer is not a complete answer to the exact question but I leave it as it does explain some principles and works well in another related situation.
Here I answered a question in a way that can be less easily generalized. I left the answer undeleted, because it could help with some intuition and because albeit the path approach not being the best, the question is usefull in explaining that less optimal path approach.
What is this "phenomenon" called? https://stats.stackexchange.com/a/401970/
This answer is not a direct answer to your question, because it relates to a different cause of the pattern.
This answer was not useful to the original example which had a different cause, but there are many people that may run into the problem with the cause that was dealt with by the answer.
Option: don't delete and add the old answer into the new answer
I am not a fan of it. This can lead to complex and confusing long posts.
I have an example here for the question What is the smallest $\lambda$ that gives a 0 component in lasso? and as you can see in the revisions I have been struggling with it having first deleted the old answer, then re-added it.
Option: delete the answer and leave a comment that explains the deletion.
Option: deletion with an edit/disclaimer in the question that explains the deletion.
Here I had many and long comments which I placed in a deleted question. Possibly it could have been an undeleted question with some different formulation, but I regarded it as not an answer and just a hack to place a more advanced comment.
Option: deletion without any comments, edits, or explanations.
I have examples of this. It is not good practice.
Accepted answer that can't be removed
Here one might edit the question. Either with a small note or very rigorous like here: