It's not a short term proposition, but it's something that ought to be taken into account when e.g. considering how governments allocate subsidies or weigh long-term energy strategies (as Germany is doing now). Any initiative that strengthens the global market for oil and gas has a side effect of destabilizing the rules-based world order.
It's not a bad idea to do it regardless, but you're just trading bad for bad if your primary reason for doing so is to avoid naughty governments.
I'm curious — do you prefer e.g. the Chinese governance model over the democratic model? I'm getting the feeling you believe that autocracy is inevitable and unstoppable, and I wonder if you believe that that fate is also desirable.
The cases where they have been demonstrably effective are comparatively few, and the geopolitical circumstances are substantially different in those than now with Russia invading Ukraine.
Pretending that massively investing in solar, wind and EVs will absolve us of dependency on autocratic regimes is just intellectually dishonest- we are merely trading one for another.
For the record, I do support temporarily ceasing the purchase of oil from Russia. Buying more oil from Venezuela, Iran or Saudi Arabia is not a long term answer, or rare earth metals from China (who is notably not participating in sanctions). Though Russia has yet to ramp up production, they will also become a key player in a post-fossil-fuel world as they are thought to have a full quarter of the accessible supply.
Now the question should be, will following through on the threat mitigate the harm now or in the future? Against Russia, my guess is no. They also haven't been successful against Iran or any number of other counties.
It might be said that the effectiveness of sanctions is entirely reliant upon being able to keep a weak nation weak, rather than preventing a strong nation from preying upon weaker neighbors.