Past performances don't predict future development.
We will find ways out of this predicament, the real question is who will be counted under those "we". Being far away from the equator and well above current sea level will help as will already having invested in green energy.
One prediction is that we will have "eco-dictatorships", voted in or forced by an ever growing protest movement. Our current capitalist system and plutocratic government are not equipped nor willing to transition to a sustainable economy. Our current system needs growth to function but eternal growth isn't possible on a finite earth.
We are bad at preparing for bad times if we have no experience with such, especially when we can procrastinate because the bad times are still far in the future. The bad news is that it may be too late when we get the experience. There are trigger points after which we can't go back, even if we stop producing CO2 tomorrow. And we may be behind some of those trigger points.
So, yes, the future looks bleak and
civilisation may end by 2040 but the end of civilisation is not necessarily the end of mankind.