You're using BEFORE ROW to initialize the target variable? That's the wrong place. Use BEFORE INSERT. BEFORE ROW will be called for existing and new rows. BEFORE INSERT will be called for new rows only. The initialization of the new row happens when returning from BEFORE ROW and before entering BEFORE INSERT.
Some other remarks: you can simplify your code: The builtin function arr_curr() returns the index of the current row in the current context. Calling "dialog.getcurrentRow('<screen-record-name>')" is only required when accessing the current row of another dialog or another sub-dialog.
-- old:
LET arr_val[dialog.getcurrentRow('record1')].rec1 = 'example'
-- new:
LET arr_val[arr_curr()].rec1 = 'example'