The longest-task calculation spread every recorded task into Math.max, which overflowed the call stack on traces carrying hundreds of thousands of tasks — the same failure already fixed for collecting trace events.