That's disturbing and it shouldn't happen but you knew that already.
Unfortunately, I've seen this before. Do I need to replace my hard disk?
Not necessarily, but I recommend more than just one Time Machine backup, with at least one of them kept geographically separate from all others at all times. That means a minimum of three backup devices.
Then open Disk Utility and "verify" the disk containing those photographs. If it finds problems and it is the Mac's startup disk then "repairing" it requires booting macOS Recovery.
How to repair a Mac disk with Disk Utility - Apple Support
Usually, a traditional spinning hard disk drive exhibits symptoms of failure long before it fails completely. Those symptoms usually manifest in poor performance, giving you lots of advance warning before it becomes completely intolerable. Mysterious file corruption in the absence of other causes (see below) or symptoms is extremely rare.
Never use any non-Apple disk "optimizers" / "managers" / "cleaners" / "doctors" / "anti-virus" products / similarly categorized junk. Hopefully that just goes without saying.