I believe there is a connection in so far as they are both massive projects taken on by Western governments, costing vast amounts of taxpayers money with huge expectations over a long time frame.
Today we see the outcome of the policy to turn Afghanistan into a modern democracy, a policy which has cost many thousands of lives. Many said it could not be done. The British Empire could not achieve it, the USSR could not achieve it. It is now absolutely clear that the Western nations, mainly the USA and the UK had failed to create any effective Afghan army despite 20 years of effort. Not only that, but they seemed unaware that this was the case, unless they did know and still left a hopeless Afghan army to allow the Taliban to return to power within a few days of the departure of Western troops.
So what about the policy on climate change? It too is massively expensive and is supposed to deliver us from the threat of severe weather. The policy goal is to rid us from the use of fossil fuels and instead rely on things like wind and solar energy instead. Many experts have said this is not possible without severe reductions in our modern lifestyles. It also requires all major industrial nations to join the West in ending fossil fuel use.
The evidence tells us that this is not happening. China, India, Russia, and Brazil have continued to expand the use of fossil fuels, while making vague promises of reducing at some time in the future. To achieve an improved climate can never be proved as severe weather has always happened and always will, so they will simply declare success when fossil fuel use has been reduced, just as they now try to claim that Al Quaida has been defeated despite the return of the Taliban.
This all points to another failure, but not before our cost and standard of living have been seriously affected.