If a display panel has no icon then reading it returns nil, according the the docs it cannot be nil.
You cannot clear the icon of a display panel either.
/c game.print(serpent.line(game.player.selected.display_panel_icon)) -- nil
/c game.player.selected.display_panel_icon = nil -- fails
/c game.player.selected.display_panel_icon = {} -- fails
Expected behavior: reading nil becomes documented, and writing nil to clear the icon becomes supported.
LuaEntity::display_panel_icon reading/writing nil
Re: LuaEntity::display_panel_icon reading/writing nil
Thanks for the report. Issue is now fixed for 2.0.65.