I presume your intention was to filter to the front but you got caught out by the lights changing before you got there, hence why you hesitated and stopped it also seemed to me that when you came into the gap, it wasn't quite big enough for your bike. By filtering when you haven't got time to get to a safe position at the front, and you're not sure, when you start to filter, if there would be an appropriate gap to fill, you are leaving yourself vulnerable by being in the middle of two moving lanes of traffic when they all pull off.
only filter when you're sure you can get to the front. if you get caught out, don't stop, keep your speed and make a smoother entry back into the line of traffic.
Something my driving instructor said to me... If, when approaching lights, they are on green, you can guarantee they'll go red before you get there, and vice versa. This applies to bikes too (even more so because we're slower). The lights were on red when you approached, the queue was long. It wouldn't be unreasonable to think the lights were going to change before you got to the front, leaving yourself vulnerable between the two lanes of traffic.