This is by design and is NOT a bug. Teams always shows the last 4 people who have spoken. Microsoft is considering increasing the number to 9 active speakers and possibly more in the future, but for the time being the 4 speaker limit is by design.
If you want to see the whole class, consider using Zoom or BigBlueButton.org as alternatives.