The Ruckig trajectory smoothing plugin extends the duration of all waypoints if smoothing isn't successful. It's an iterative process until success is achieved. Attempt smoothing --> extend the duration --> attempt smoothing again.
for (size_t time_stretch_idx = 1; time_stretch_idx < num_waypoints; ++time_stretch_idx)
{
The resulting trajectory could be faster if only the failing waypoint durations were extended. There's no reason to extend all of them at every iteration.