IIRC, the Red Sphere, Blue Sphere stages in S3&K all required you to collect every one of the blue spheres on the stage. But I could swear I've had a few instances in Sonic Mania where I've finished a stage with blue spheres left in front of me. Do some of the later stages have surplus blue spheres?
You can definitely finish a blue sphere stage with some number of spheres still remaining. I'm pretty sure this is a bug, but I haven't found any definitive sources. I have seen people mentioning this on Twitter before.
I'm guessing the way the game removes one additional blue sphere from the counter when you clear a 3x3 square is that it checks for three things:
- If the four corners have turned red
- If Sonic is within the 3x3 square
- If rings have been spawned at that location
Now, if you watch the video again, you can see that those three conditions are true, so the game removed another blue sphere from the counter.