In the list of build-in array methods and ui.Dialog methods there are similar sounding methods to insert, append, and delete. These include array.appendElement() and DIALOG.appendRow().
The common mistake is to use an array method when the array is attached to an active dialog.
Simple rule of thumb is that if the array is being maintained by active dialog then you should use the ui.Dialog method and not the ui.Array method.
Read more at
https://4js.com/ask-reuben/ig-238/