Ideas
The yellow flag is a signal of danger.
During Free Practice and Qualifying, it must be evident that a driver has not attempted to set a meaningful lap time.
And that's probably why the game forces such a slowdown by not using boost mode during yellow flags. This prevents anyone from achieving a good time during a yellow flag. In real F1, there's a penalty for doing so (e.g., having your lap time canceled). In real-life races, there are many situations that make it difficult to achieve a fast time in qualifying: track congestion, a change in weather to rain, yellow and red flags, and in Canada, even whistling (damage to the Williams car), poorly installed manholes...
The game tries to be realistic.
understood but in F1 25 game, same conditions, this scenario does not trigger a performance drop by the game. Even in real F1 yellow flags are not typically waived for cars yielding for other cars, maybe a blue flag is waived, but the game lumps all slow moving or stopped traffic as yellow flags. Only the DLC is there a performance change by battery mode changing.