2002 Santa Fe powering off while driving

I recently bought a 2002 Santa Fe with 135k miles.The AC compressor had been replaced about a month before I bought it.It ran perfectly for about 4 weeks.A few weeks ago it started turning off while driving.The AC and radio shuts off for a split second then powers back up.A few times the whole suv turned off but restarted on its own.The dummy lights came on for a second as well.I could hear the engine making a clunk sound when it shuts down and the tachometer bounces all around for a second. I had it in the shop and they said the alternator and battery were charging just fine.It cranks up perfectly when I go to start it.I wonder if you guys think it could be electrical or a fuel problem perhaps? I’m no expert.I’m hoping you guys will have some ideas.Thanks for reading.

Something like this, I would start with the ignition switch, first.

Do you keep your ignition key on a chain with a lot of other keys, and heavy objects?
This sometimes will damage the ignition lock over time.

BC.

No, it’s on a ring with only the lock/unlock remote. The car starts up great without any kind of noise or problems.Would the ignition switch cause the power to shut down while in operation? I thought it was only to do with starting the vehicle.