How do you reorder an entity reference revisions field during hook_node_presave?
You don’t need to re-create the array of target IDs by creating all that $new_values stuff.

Just set the entities like this:

$node-&gt;set('field_paragraphs', $entities);