Giving them another gun doesn't really help, as soon as they run out of ammo on it they revert back to the infinite ammo unbreakable magic gun, hahah.
Give them alot of ammo, Boone uses the Sniper Rifle and I just give him more ammo whenever I barter.
No it's a glitch, when you leave the casino sometimes your companions main gun is in your inventory. I know with Boone you can't give him his weapon back, the rest I'm not to sure about since it's only ever happened once with Raul.
I know it's a glitch I just didn't know if shooting at Tops helped start the glitch, that was the only time it did that to me in 200 hours.