I vaguely recall having the same issue on my King Pin years ago. From memory, there is a bonus unit under the playfield around where the target assembly is. Tighten any switch stacks and clean the contacts with a business card.
It was a problem that took me ages to find - but the "unit" was right in front of the target assembly.
It is giving you a random 5000 problem because when the target is lit and dropped it scores 5000. All other targets score 500.
I wish I still had my King Pin !
Nino was it the mini stepper unit that controls the position of the red lights infront of the target bank? It is activated by a star roll-over. I looked at this thing, but dismissed it as a cause.
This unit looks very similar to a "match unit" on a williams EM. It is smaller than a stepper unit. This gave me all sorts of random issues that remind me of your problem. Don't dismiss it yet !
Can you attach a picture for me please - see if it reminds me of the fix.