I cannot easily test on 18.2. I tried to reproduce on 19.2.
You mention master detail but I can't tell from your steps if all the steps are done in the master or the detail IG or if it matters.
If you add a row to the master a new detail is added and it typically has a new row added automatically (because of Add Row If Empty). In step 2 is it the master or detail row that you are removing? Because of Add Row If Empty if you delete the new/only detail row it will add a new row again.
I believe I was able to reproduce this and it had nothing to do with master detail.
The error I get is "Error in action for 'edit'. TypeError: "rec is null"" This is in Firefox.
press Add Row
press Edit to leave edit mode
press row actions menu button on the added row and choose Delete Row
press Edit to enter edit mode
I entered bug 30522226 for this.
In step 2 is it the master or detail row that you are removing?
I remember it was the detail one. And the IG had other rows already.
I tried it now. But the Edit button is clicked twice this time. Maybe that is what happened when I posted the thread. I actually can not remember.