I got the following bug report which led me here: https://mods.factorio.com/mod/map-tag-generator/discussion/667ea15dc14047639301c742
In control.lua in build_result_tag(), tag.icon is of type SignalID, and the name field of that type is optional, so you'd need to check if it's nil before using it in the caption. I have no idea what tag actually ended up causing this issue (I haven't been able to reproduce), but I believe this should fix the original issue.