Passed school bus

I live in Wake County NC - a majority (I believe around 60% of school buses have stop arm cameras). This morning I was driving to work and stopped behind three cars - we were all stopped behind a bus who was collecting children. The bus collected the waiting children, put away its stop arm/sign and turned off the blinking lights. The three cars ahead of me began driving and passed the bus. I was following the traffic and AS I WAS PSSING THE BUS (whose stop arm was not out/flashing lights not on) with the flow of traffic it began extending its stop arm AGAIN and turned on its flashing lights. The stop arm appeared fully retracted/near fully retracted in my rear mirror as I looked back (approximately 20 feet ahead of the bus). Apparently the bus had stopped again for a late straggler trying to catch the bus. I guess this is technically a violation of the law, but there was no time for me to stop as I had already passed the bus as they began retracting the stop arm for the second time. Has anyone experienced a similar situation? I fully plan to go to court and fight it if I do indeed get a ticket but I’m obviously worried because I would never ever in my life pass a stopped bus intentionally. I’m really distraught by the whole ordeal. Any experience/advice appreciated!