First, I'm really sorry about what happened with your friend






Whatever your teacher had lodged up her inner crevasses is seriously affecting her judgment. You need to take this higher than her. She had absolutely zero right to treat you that way. Teachers like this destroy schooling, in my opinion. Please try your best not to let her control you like that. It's probably something relating to her personal life at home. She knows she can't control that, but at least she can control her students. It's not fair, it's not right, and I really hope you can do something about it!
If the grade comes back negative in any way for being late, DO NOT take it. Don't even accept the paper back. In fact, I'd have a number ready to call in case she tries something like that. If you've got a cell, whip it out and dial away. When she asks you what you're doing, tell her you're reporting her
Most importantly, don't let this get your own self esteem down! You were doing what was right, there's nothing you could have done any differently. Take pride in the fact that you still even managed to finish the paper! Lots of people likely wouldn't have in your spot (I know I certainly wouldn't have). Keep on going, good luck with the rest of the class, and take care of yourself
~TheDeliciousDish