The thing you are undergoing is very common with Lakhs of people day in and day out. Failing in a semester exam should not bother you, over a long run when u look back all these things seem very silly.
I have seen my friend in my college who just passed 1 subject out of 6 in first semester and kept 5 back logs for the second, Attempted 5 + 6 in the second semester managed to pass in 8 and kept 3 for the third semester and chaining it up completed all the backlogs by when he reached 8th semester,
Since you are an IITan you might have not tasted any failure in life, coming from a tire 2 college, people all around messed up their academic life, so many backlogs, half of the class getting detained for the next year and so and and all are OK with it, it's any how a normal.
To your surprise they struggled after passing the college got into decent jobs and leading some teams in good companies, having their own business and some are still struggling ( a fraction of the who still have not understood how to handle things).
If you ask me, there is no clear definition of success in Life it differs from person to person, for the same person what was success when he/she was young was no more through the years of age, and now he/she has found a new definition for success. Tomorrow it will be something else.
So relax, life is not the refection of other's success with your failure, it's just your life.
Come to villages and see consecutive 5 crops with no yield, people are doing away with 1 meal a day,
they still laugh at each other's jokes and don't even know the concept of feeling depressed.
They know rains will any how gonna come, they life for that day.
You will any how pass, for sure land in a job, after 10 years come back and see this post when u will be holding some responsibility, you will be laughing at your own past.
Chlll and continue watching those anime, study sometimes. Be happy.