I'm looking to add custom icons to the layerList widget. As you can see below, I achieved occasional success by following the documentation example here https://developers.arcgis.com/javascript/latest/sample-code/widgets-layerlist-actions/

I use an async listItemCreatedFunction, with an await item.layer.when(); and then I create a custom DOM element to hold the item.title with the custom icon. However, I can't make it work consistently.
Any suggestions? Thanks in advance.