In the onBeforeRowHeaderDomAdd event handler, you can specify the target that of the custom element using the args.target property. By default, it is set to "Cell". In this case, it will overwrite the whole cell content, including the expand/collapse icon.
The other option is "Text". This setting will will replace the text content of the row header cell. The text element is indented according to the current level and to make space for the expand/collapse icon.