Thing is, it wasn't hindsight. The US had been warning Europe about the dangers of dependency on Russian energy since at least 2016 through 2-3 administrations (see my other comment for the citations).
Yes and europe was warning the US not to engage with Iraq and now Iran in the way the US did.
Also we read the warning as "don't buy from them, rather buy from us".
And it was extensivly debated in general.
This warning goes back much much longer than 2016 even. Minimizing dependence of Europe on USSR/Russian energy was an unsung large part of Reagan's administration's strategy for winning the Cold war which was largely an economic battle whose policy preconditions for economic warfare were set as far back as 1962.
After Reagan's election in 1980 the US tried very hard to slow and/or block the creation of the Urengoy–Pomary–Uzhhorod (Trans-Siberian) pipeline when it started imposing sanctions on the USSR after it declared martial law in Poland. German president Schroeder had agreed to the pipeline in 1980.
The US imposed export controls on technical equipment used for building that pipeline. It urged European governments not to build the pipeline, it then expanded the embargo to all global subsidiaries of US companies and anyone with licenses with US firms. The US even allegedly created dummy plans for covert defective pipeline equipment and leaked those plans resulting in a trans siberean pipeline explosion that delayed the project. (Some claim the explosion was caused by bad construction techniques and/or was just a psyop.)
All this to pressure the Russian economy which was not in good shape and for whom the pipeline would have been an economic lifeline for the USSR. The Europeans, wanting to reduce middle eastern dependence on oil persisted and eventually got the US to rollback the global sanctions in return for other forms of sanctions. Peter Schweitzer wrote about this as early as his 1994 book "Victory" but there are various others who have covered it since. The pipeline started shipping oil to the French in 1984 despite all that. The US started its pipeline focus rather late in part because it did nothing under Carter, but the energy dependence it helped lock in was a major, major bone of contention in the early 80s between the US and Europe.