How to add a new line item to existing recurring order?
It works even with:

if (!empty($order-&gt;data['lis'])) {
  foreach ($order-&gt;data['lis'] as $key =&gt; $li) {
    $line_items[$li-&gt;line_item_id] = $li;
  }
}


However, to avoid re-adding new line item every recurring cycle, the hook_commerce_order_update should be used instead as recommended on https://cgit.drupalcode.org/commerce_license_billing/tree/commerce_license_billing.api.php#n129:


  Modules that need to respond to a license plan or recurring order
  changing should use hook_commerce_order_update instead.