AC-3 Algorithms on CSP problem, What is happened when enocunter to an empty domain variable?
You've misunderstood the book.  It's not describing the AC-3 algorithm; it's describing some other algorithm.  The book is describing an algorithm that combines both guess-and-backtrack together with arc consistency.  The AC-3 algorithm doesn't do any guess-and-backtrack; it uses only arc consistency checks.

Thus, AC-3 does terminate if there is some variable whose domain set becomes empty; in this case, AC-3 declares the constraint system unsatisfiable (inconsistent).  This is the correct thing to do, in the context of the AC-3 algorithm.

Of course, if you're talking about some totally different algorithm (like the book is), that other algorithm might do something totally different.  No great surprise there.

I don't see anything wrong with the answer to the Stack Overflow question you link to.