Sorting (in particular descending) in Gantt (V1.3.3.0) fails

Dear Support Team,

the following code triggers an EArgumentOutOfRange exception when sorting in descending order:

procedure SortingExample;
var
  mainnode, subnode1, subnode2, st: TTMSFNCGanttTask;
begin
  TMSFNCGanttChart1.Project.BeginUpdate;
  try
    TMSFNCGanttChart1.Project.ClearTasks;

    mainnode := TMSFNCGanttChart1.Project.AddTask('Main Node');

    subnode1 := mainnode.AddSubTask(
      'Level 1a', '');
    st := subnode1;

    subnode2 := subnode1.AddSubTask(
      'Level 2a', '');
    subnode2.AddSubTask(
      'Level 2a - Task 1', '', EncodeDate(2025, 12, 01), 2, gdtWorkDays, whWorkDaysOnly);

    subnode2 := subnode1.AddSubTask(
      'Level 2b', '');
    subnode2.AddSubTask(
      'Level 2b - Task 1', '', EncodeDate(2025, 12, 07), 2, gdtWorkDays, whWorkDaysOnly);
    subnode2.AddSubTask(
      'Level 2b - Task 2', '', EncodeDate(2025, 12, 05), 1, gdtWorkDays, whWorkDaysOnly);

    subnode1 := mainnode.AddSubTask(
      'Level 1b', '');
    subnode1.AddSubTask(
      'Level 1b - Task 1', '', EncodeDate(2025, 12, 09), 1, gdtWorkDays, whWorkDaysOnly);
  finally
    TMSFNCGanttChart1.Project.EndUpdate;
  end;

  TMSFNCGanttChart1.SelectedTask := st;

  if Assigned(TMSFNCGanttChart1.SelectedTask) then
  begin
    if TMSFNCGanttChart1.SelectedTask.CountSubTasks > 0 then
    begin
      TMSFNCGanttChart1.SelectedTask.SubTasks.Sort(
        'wbs', true, true, FALSE); //fails
      (* TMSFNCGanttChart1.SelectedTask.SubTasks.Sort(
        'wbs', true, true, TRUE); //OK *)
      TMSFNCGanttChart1.UpdateGanttChart;
    end; //if
  end; //if
end;

At first, I thought it was due to the layer depth. However, there are various scenarios where it sometimes works and sometimes does not. In some cases, it seems to be related to the date of a task. Sometimes ascending sorting does not work either, but I cannot reproduce it consistently. It seems to depend on the number of tasks contained in a subnode.The best way to reproduce this is with the attached example. I would appreciate any assistance.

Hello, this is a problem in the UpdateGanttChart method.

This will be fixed in the next release, but for the moment you can avoid this error by a BeginUpdate/EndUpdate.

    if TMSFNCGanttChart1.SelectedTask.CountSubTasks > 0 then
    begin
      TMSFNCGanttChart1.BeginUpdate;
      TMSFNCGanttChart1.SelectedTask.SubTasks.Sort('wbs', true, true, FALSE);  
      TMSFNCGanttChart1.EndUpdate;
    end;

Thank you very much for your prompt help!