You will need to remove the data-detail, data-breakable and data-expander attributes from the table. The data-expander attributes belongs to the new dynamic table logic. In your case you are doing your own expanding (adding rows to the table via a script). The only attribute you need is the data-breakable attribute on the table rows (there is no need to add a sequence number to this attribute). Data breakable is used by the initial table splitter algorithm to decide where page breaks should happen. This attribute belongs to the original dynamic table logic.
When inserting a table via the Insert Dynamic Table wizard you will get the attributes belonging the new implementation as described in the links I posted in an earlier comment. The goal of the new implementation is to remove scripting required to create dynamic tables based on nested detail data (sub detail records).
Hope this helps,
Erik