Maybe seller got another offer and is looking for a way out and to keep your friends earnest money?
If that isn’t the case, offer them a bit more to let the electrician replace the panel prior to closing. If your friend doesn’t have a few thousand to get this done, then buying an as-is house is probably not the right choice. Can they put it on a credit card?