I hesitate to contradict JBI, especially since I'm a Linux user rather than a MacOS user, but MacOS is supposed to be Unix-like, and if so, the error you report, "invalid directory count", is very minor. Just use the MacOS equivalent to f s c k ; see here
Ha, f s c k is banned, even in URLs!
However, your system also reports "filesystem verify or repair failed". If this means that f s c k can't repair the error, I'd consider the possibility that the hard disk is physically defective. I'll let someone else suggest the MacOS equivalents to smartctl and badblocks.