Place order from code with custom price

We’re placing orders from code using the example code from here, Create order from code (Litium 8) - Questions - Litium Forum and everything works fine.
However, sometimes we need to set a custom price on the order row. How can we do that?

Tried doing it like this but it throws an error saying the object is read only.

var orderRow = cartContext.Cart.Order.Rows.FirstOrDefault();
orderRow.VatRate = 1 - (cartContext.Cart.Order.GrandTotal / paidAmount);
orderRow.TotalExcludingVat = _roundOffService.Round(currency.Id, orderRow.UnitPriceExcludingVat * orderRow.Quantity);
orderRow.TotalIncludingVat = _roundOffService.Round(currency.Id, orderRow.TotalExcludingVat * (1 + orderRow.VatRate));
orderRow.UnitPriceIncludingVat = _roundOffService.Round(currency.Id, orderRow.TotalIncludingVat / orderRow.Quantity);
orderRow.TotalVat = orderRow.TotalIncludingVat - orderRow.TotalExcludingVat;
orderRow.VatDetails = [new VatDetail { VatRate = orderRow.VatRate, AmountIncludingVat = orderRow.TotalIncludingVat, Vat = orderRow.TotalVat }];

Also tried to make a writable clone of the cartContext.Cart.Order, do the changes and then put the order back, but we get the same error then.

Litium version: 8.20.3