.Since you were expecting a different ending, evaluate how successful the author was in convincing you to accept the validity of the “surprise ending” that was not clearly suggested at the beginning.
Though the surprise ending is far from my basic assumption, Descartes managed to convince me through his admission of the perfection of God from whom the human capacity to think originated. It persuades me to agree with the power of reason as Descartes acknowledged that something or someone is greater than him and his potential to form thoughts or ability to doubt where he justifies the validity of reason over senses and cognition by reasoning itself. The philosopher at the time seems capable of being open to the light of all metaphysical and spiritual possibilities that need not be sustained by material or physical evidence in his quest for truth as long as his approach leads him to a gradual and clear discernment of evidences when awake.  .