There was a comment here on the Ruckig trajectory plugin PR which also applies to the other plugins in the moveit_core/trajectory_processing folder:
The code would be much more readable and consistent with MoveIt if you would use the joint group instead of passing num_dof and joint_idx everywhere.
Essentially, replace the usage of idx and num_dof with usage of the Joint Group API.