When I see things like that, an obvious hack, I immediately suspect the entire system. I can't see it very well in the photo, but Romex is not designed for use as an extension cord; it's for permanent installation inside a wall, not to be poked into a hole next to a pipe. Even if it's SO cord, that isn't the way it's done. If they did this, what else did they do? I can see some sort of box in your photo below the panel that looks like it's missing a bushing. That would instantly, and appropriately, fail after a casual glance by the drunkest of corrupt electrical inspectors.
I'll paraphrase whoever said "A cub goes just barely fast enough to kill you", into "there is just enough energy lurking there to kill someone or burn the place down". As an example, how would you react to this statement? "Aircraft hardware is expensive; that's why I got my prop bolts at Malwart for 1/8 of the price that Craftspruce Air sells them for. But it's okay because they were installed by the speedy-lube guys using their best rattle-wrench".
My experience with home inspectors is that they are useful and necessary, but most of them aren't electricians, plumbers, carpenters or hazmat specialists, and don't claim to be. They typically make statements like "problems were noted with electrical installations and further investigation by an experienced electrical contractor is recommended", which I think is appropriate.
My advice is to get a very experienced licensed electrician to evaluate everything, starting with the service entrance. Or at the very least, anything that looks like it was added after the original installation.
It may cost a few bucks to straighten this out, but the possible alternatives are pretty grim.