Drupal 8, Commerce 2 custom products, variations and order items
When setting the unit price, you must set the override parameter to true as so:

$unit_price = new \Drupal\commerce_price\Price('9.99', 'USD');
$order_item-&gt;setUnitPrice($unit_price, TRUE);
$order_item-&gt;save();