Assuming that there's already at least one upvoted answer (regardless of whether it should've been an error or not), you can no longer self-delete the post.
Not sure that there's a best option in such a situation (the best option would be to proof-read the code before posting), but this is what I'd do:
Accept an answer.
Edit the original question from:
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
to:
###Note: This question is an error. There's no problem here.###
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
The message could be customized. It's merely there to inform future visitors upfront that there's no actual problem in the thread.
- Lastly, post a new question regarding your original problem. Treat it as a new standalone question.