Thanks for reply, Marijn!
Now I tried
this.editor.view.dispatch(this.editor.view.state.tr.setNodeMarkup(position, undefined, newAttrs));
also
this.editor.dispatchTransaction(this.editor.view.state.tr.setNodeMarkup(position, undefined, newAttrs));
but it did not work
But even if the reason is the transaction not beeing dispatched why it worked in first function where were no dispatch at all?