I can't judge if you should apologise, that's for you to decide. You know exactly what happened, and if an apology is appropriate. Maybe your parents, counselor or year head can help you with that.
I think you should explain the teacher what happened, so he understands. He may not know what to expect from you, and may think you were doing something on purpose (which you didn't). Like for example misunderstanding your panic attack for disruptive behavior.
If you're up for it, go tell him yourself. Your year head probably knows a thing or two about you, but you still know best. It also shows your teacher that you are really sorry for what happened, and that you take it seriously. Teachers tend to be a lot more cooperative/understanding when you come to them directly, rather than letting someone else do it for you.
If don't want to go in alone, ask your parents or counselor/year head to go with you. Try to tell your story yourself. The adult with you is for backup or background information. You were there, they weren't.
The fact that you're asking for help here says enough: if you can explain what happened here, you can explain it to your teacher.