Mossberg 500's have a bad habit of having the screw on the safety button loosen up. When that happens, the little ball bearing inside falls out and sometimes causes the safety to jam. If the screw comes all the way out the safety can get stuck in the on position.
While it doesn't need replaced, this is one detail that needs checked every once in a while to make sure it doesn't loosen up. I had one this happened to, with a deer standing in front of me. The gun was a dedicated Mossberg 500 deer gun and on its 2nd deer season. The other one that I saw was our former blacksmith's hunting gun.
The cure is Guntite, or NON-permanent Loctite. I also replaced the plastic safety button with a metal one. I cannot comment if current buttons are plastic or metal, mine was plastic.
The screw holding the ejector in (on the gunsmith's gun) also came loose, which caused the mechanism to jam. I helped him repair that also.
Bottom line, on a HD or in fact any gun, simply make it a habit of doing preventive maintenance, such as checking for loose screws, proper lubrication for the gun's application, etc.