That is what gears are for. The only time gears fail is when you want to pedal harder without going faster - charge the battery. Downhill with a tailwind the cautious can reach this situation, but most just go faster.
The way I read it is if you use throttle-only you can reach 20 mph, but then if adding pedal-power you reach 28 mph. The pedal is probably not generating sufficient force to add 8 mph, but it’s telling the control system to do that.
class 2 and class 3 are mutually exclusive. You cannot legally have an e-bike that supports throttle up to 20mph that can also continue to e-assist if you pedal up to 28mph. While it's technically possible in software to switch between these modes, consumers aren't supposed to be able to do this on their own.