From the OpportunityLineItemSchedule documentation under the Effects on Opportunities and Opportunity Line Items heading.
Deleting an
OpportunityLineItemSchedule decrements the OpportunityLineItem
TotalPrice by the deleted OpportunityLineItemSchedule Quantity or
Revenue amount.
The Opportunity Amount is also decremented by the
OpportunityLineItemSchedule Quantity or Revenue amount, and the
Opportunity ExpectedRevenue is reduced by OpportunityLineItemSchedule
Quantity or Revenue amount multiplied by the Opportunity Probability.
Also under Deleting an Opportunity Line Item Schedule:
Deleting the last remaining schedule will set the corresponding
HasQuantitySchedule or HasRevenueSchedule flags (or both) to false on
the parent line item.
So the behaviour you are seeing when deleting the the OpportunityLineItemSchedule records from Apex sounds correct. The OpportunityLineItem Quantity will decrease.
You would need to increment the OpportunityLineItem Quantity again in apex code after deleting the OpportunityLineItemSchedules.