Surely, the most significant part of your question is the fact that you were at a BOX JUNCTION. You chose to enter the box before your way was clear to exit. YOU are completely in the wrong for that reason. Whether or not the question of the red light comes into in, you have committed an offence and hopefully will be punished severely, because there is just no excuse for your action, the very fact that you were stuck in the `box` demonstrates the point.
[edited by ABED]