wow, thats just poor workman ship. Did they even use lock washers ?
The fix, IMO I would try to to tack weld the nut to the bed slightly(so they could unbolt it from the top someday if needed). then close the beam back up with a fish plate ect. Then primer,then undercoating.
The guy who worked on it would not be touching my truck again.
p.s. that bolt does not look like a stainless bolt, all bolts ect should be stainless. it will rust on the first rainfall if not and every thing around it will rust ..
p.s.s. god the thing just erks me ... that holds a fuel tank? that tank is going flying if you crash ect. that nut will pull right through that tin faster than snot .... it should be plated on the bottom .