Most probably the collection assigned to DataGrid Data property is null in your case - InsertRow() will not work in this case. You will need at least empty collection where you can either add new item in the collection and call Reload() for the DataGrid or use InsertRow().
I checked my collection, it was defaulted by "Enumerable.Empty()", in my case, the situation was triggered by "ShowEmptyMessage" property at true value.
Maybe in an empty state using "ShowEmptyMessage" the data grid property become null?
I had this same problem. My solution, based on your post, was to turn off the "ShowEmptyMessage" when inserting a new row, and to turn it back on again once the insert was complete or canceled.