Correctly pass the insert ID of the undo record (see #6234)