It depends on what one calls happy. The ending of Don Quixote is serene and sad: the defeated gentleman returns home, regains his wits, and dies a Christian, in bed, among those who love him, but he ceases to be Don Quixote before he dies, and the book's laughter falls silent.
On the side of what hurts, he loses the battle on the beach at Barcelona, spends a year without arms, sees Sancho's self-lashings end up as tree bark, and, waking up sane, renounces the books that gave meaning to his life. He laments that the disillusionment came so late, leaving him no time to read other books that are a light for the soul, and he confesses that he was mad.
On the side of what consoles, death is quiet. Alonso Quijano sets his soul in order, pays the housekeeper's wages, leaves his estate to his niece and whatever is left over to Sancho, and asks forgiveness of those he wronged, including the author of the false book. The notary says he never read of a knight-errant dying in bed so peacefully and so Christianly, and Cide Hamete concludes by saying he achieved what he desired: to make the stories of books of chivalry hateful to men.
Readings of the ending divide the commentators. For one reading, the book changes temperament like a symphony, from irony to bitterness, until a most sorrowful end. Auerbach rejects both the tragic and the symbolic. The question the book leaves, and which Don Antonio Moreno already raises when he learns that the bachelor wants to cure the gentleman, is whether sanity is worth its cost: the benefit of Don Quixote's soundness would not equal the pleasure his follies give.