I kept on thinking about what the principal said and I still can't understand his reason for such a statement. Normally even if you did not travel for your brother's burial knowing how much that could affect a student, he should have been the one to suggest you take some time off to rehabilitate.
This shows how little your principal cared about your mental health, if he had any bit of humanity in him, seeing how a teacher and your parent has gotten involved in the matter he should have at least considered your request.
Sincerely I wouldn't blame you for relenting because you were not in the perfect state of mind, probably if there was someone to remind you of the possibility of being promoted despite missing a term exam, you might have tried harder.
Anyway it is for the best, I'm glad it all worked out despite the challenges you faced. I'm sure your principal will be shocked when he finds out that you are now a writer and a book publisher.