I was completely humiliated

I’m a junior in college and I’m taking a chemistry class, I struggle big time. I’m a psych major and math and science is not my strong suit. On my chemistry exam I wrote my prof a note saying that I really struggle and that I apologize for all the mistakes and that I tried my hardest. So today when he passed back our exams he mentioned someone wrote him saying what I wrote, and then started making jokes about me. Saying that this student is basically an idiot. Everyone was laughing and everyone around me was saying “who’d write that? They are stupid. They shouldn’t be making excuses”. The rest of class I had to sit there holding back tears because I was completely humiliated. Was I in the wrong for saying that I’m struggling?