I was caught having my phone out during a final, but I failed the test so would I still get referred to the dean?
Updated after clarification from OP

Your performance on the test will be irrelevant.  If you failed the test while cheating, it would just suggest you didn't do a very good job of cheating, but that hardly negates the action.  

From the way you relate what happened, your actions are indistinguishable from someone cheating.  In fact, I'm very skeptical of your story... you were in an exam and had your phone hidden on your seat between your legs and you just happened to be looking down and tapping.  This is very odd behavior in an exam since you must realize it is indistinguishable from cheating.  Also, it makes the idea that you forgot you had your phone implausible since you had it out and on the seat right where you were looking.

I would certainly expect at least a zero on the exam, and depending on the professor/TA a report to the dean.  You must realize how implausible your story sounds, right?  Your typical exam taking behavior is to take your phone out, hide it on your seat between your legs and look down and tap on it?  No professor is going to buy this story.