"I was a very stubborn student at secondary school, and it was not until (after) I was beaten by a teacher for my poor attitude, that I stopped being stubborn and became respectful."
This sentence sounds correct, but appears wrong because I don't think grammar rules are in line with using two subordinate conjunctions side by side (...until after...).
Also, I think the word 'after' doesn't change the meaning of the sentence, that is, even if it is removed from the sentence, the idea being conveyed will remain the same. Am I right?