Note: I am aware this strategy does not work on flying types with a water, fire, or ice duel type or some pokemon with the ability levitate.
i use my weavile I am fighting a pokemon with a ground weakness I use dig they will obviously switch to a flying type then I use ice punch or if they switch to gengar nightslash.
I tried this strategy on pokemaster but never used it well becuase he used gyrados
Here are some problems with this strategy:
Plenty of Pokemon have Earthquake, which will do double damage while Weavile is under the ground.
As you said, there are plenty of Pokemon against which this strategy does not work well on. Pokemon such as Gyarados are quite common on teams.
The foe is usually smart enough to know that Weavile has an Ice and Dark type move in its arsenal, so they wouldn't just send out say a Fearow to fight Weavile. They could just as easily send out a Pokemon with Ground RESISTANCE.
The foe could send out a Pokemon immune to Dig, then just switch it out for a Pokemon with Ice or Dark resistance.
Electric and Steel type Pokemon might have Magnet Rise, so they could just use that.
Dig is unlikely going to OHKO the foe. The opponent could just withstand the attack, then hit you back.
All in all, this strategy is just too situational to be of much use. A skilled or even an average opponent would easily be able to counter this. I'd rate this strategy 3/10.