The sequence of events is rather simple, as Hans Passant explained in comments. You voted "looks ok" on an answer which is deleted. And that's all she wrote, audit failed. Just plain machine logic, nothing to take personally. The true learning to be done is not in why you failed the audit, but in how you could have prevented yourself from clicking the wrong button button that triggers an audit failure.
Given that you're actually asking how you could know what is wrong, I'm going to focus on that. There are a few paths that you could have taken that could have made you escape the pending doom, in this case. No guarantees, sometimes the red herring dangling in front of you just doesn't smell.
Path #1: actually opening the question in a new tab to scan the more complete picture. Normally, pulling out of review for a second is especially prudent when you're not familiar with the subject matter (Java) which you aren't in this case by your own admission - you are best off to see comments and possible other answers to get enough input to be able to make a reasoned review decision. heck, it can help to see if there are edits that have already been done on the content. Those are all things you can't see in review.
You would have spotted that the answer in fact no longer exists. That is basically the only clue you need that "looks ok" is absolutely not the option to choose.
This is less relevant for this particular review queue however, as Magisch rightfully explains in the comments. I quote:
Actually, you don't need to be in command of the subject material to review LQP posts. The only judgement you make in that queue is "Is this even an attempt of an answer?" If yes, "Looks OK"
That makes it especially more difficult to "catch" the audit using this method as you have a lot less reason to go look at the entire question. That doesn't change the fact that it can do the job.
Path #2: According to Magisch in the comments there is a user script which can help to spot audits, which is a safeguard against these kind of awkward/bad audit targets. I'm not going to say you must install such a thing, but you could.
When it comes to other queues there are more tricks to not be burned by an audit, indeed such as skipping when you're reviewing proposed edits you're not sure of.
I'm not going to argue with Lundin that the review audit system is broken because it is definitely flawed in several ways. But that wasn't the question asked.