The database table SCHEDULER_HISTORY is written with some information such as "job", "start time" etc at the point in time when a task starts.
If a task should run on an Agent and the Agent is not available then the database table SCHEDULER_HISTORY is not written at that point in time when the task was started.
If the Agent is available later, the task is terminated or the job is stopped then the database table SCHEDULER_HISTORY is written subsequently.
Desired Behavior
The database table SCHEDULER_HISTORY should be written at the point in time when a task starts even if the task runs on an Agent and the Agent is not available.