Your pain actually serves a purpose. When people ask on the wrong site, but get an answer anyway, they are rewarded for ignoring the rules, including not bothering to learn the rules on first arrival. Therefore the site is better served by such questions not getting answers before they are closed.
Once you lose some work by having a question closed while you were typing an answer, that pain will mean that next time, if you see something that obviously deserves to be closed, you won't start to answer it. This is a feature. You are avoiding pain for yourself, but you are also being steered away from rewarding the wrong behaviours. All to the good.
So my advice to you is to examine questions a little more closely before you answer them. Sure, there will be some mis-closings and you will still get caught by surprise on occasion, but you should be able to reduce it to the point where it no longer is much of an issue for you.
And what about the case where you did examine the question, and it should not have been closed? The solution to that is to re-open it. Being able to squeak an answer onto it before the wrongful closing is not an appropriate workaround for the presence of wrongful closings. Solve that problem rather than trying to mitigate the effects of that problem.