I believe in afterSubmit the scriptContext.newRecord and scriptContext.oldRecord are read only. You would need to re-load the records from the DB, makes changes, and then submit. Best approach is to make changes to the current record in beforeSubmit (if possible) so you don't have to reload.