The "hard drive" of this Pi is actually a micro SD card.
Any flash memory of course has a limited number of write cycles, and since a Linux system is constantly writing log files etc. to the disk, and you say you're regularly writing image files to the disk, two years isn't an unreasonable time for the SD card to start failing if the system was in operation the whole time. I'm also not sure how widespread Wear leveling currently is on SD cards.
But what I really don't understand is how that file from 2019 (With.pm) was changed but the filetimestamp didn't change. Maybe a corruption doesn't always trigger a timestamp update?
Physical damage to the storage medium (or corruption of the flash cells) wouldn't be reflected in the file's timestamp. However, I can almost guarantee you that this wasn't the only file affected. I'd strongly recommend replacing the SD card ASAP. Recently there are also new "endurance" SD cards (e.g. from SanDisk, Samsung, and Transcend) that promise to have higher write endurances.