similar happened to me only the whole tab, not just the welded nut, disintegrated. it had me scratching my head for a bit.
Sounds like yours is slightly less catastrophic so you could just dremel off the old nut (will only have a couple of tacks to hold it in place) and put in a rivnut (maybe the hole will be too big for rivnut to be secure) or slide a chimney nut / speed nut (i think its 4mm) over the tab.
Mine was so far gone I filed off what was left of the tab so there was none left at all just clean metal in the headlight bowl. Then I cut some 2mm steel plate, about 3cm by 10cm. Not wanting to get into welding or brazing. I drilled one end to take a rivnut and the other to take a regular rivet. Bent up about 3cm of the end and fitted the rivnut. After much measuring, I drilled the bowl about 6cm in from the edge (to ensure I only had to rivet through one thickness of steel - not a section of double thickness where the bowl is spot welded to the wing) and rivetted the plate to the bowl. Finally I applied loads of anit rust primer and top coat and silicone sealant around the edges an to the back of the rivet.
If you're like me you'll want nice new rubber seals to stop it happening again but you'll then struggle to get the headlight back in nicely cause they're much fatter, after much farting around I found a liberal application of vaseline sorted it nicely. Also put loads of anti seize on both the "piggie back" screws holding the weadlight and trim ring in.
Alex