When doing an onchange on some existing record, the x2many commands must be applied on the current x2many value of the record. When doing an onchange on a new record, the x2many commands must be applied on empty x2many values. Part-of: odoo/odoo#124612