Weird Kia behavior

This car runs like a top most of the time. But lately it will sudenly lose power (press the pedal, no go), the speedometer goes nuts jumping from 0 to 50/60 and back, and the check engine light goes on. So far, the dealership hasn’t been able to figure out what’s going on. so what’s going on?

I would look for a loose electrical connection between the battery and the frame.
Then I would test the alternator output under load.

BC.

Check ground connections, including the strap(s) from engine to chassis and the connections to the battery negative terminal.

That CEL (check engine light) is just a kid in class waving her hand trying to get you attention because she has the answer. You need to have the codes read. Some places will read them for FREE. Try Autozone or Advanced Auto Parts. Get the exact code (like P0123) not just their translation into English and post it back here.