The book and the movie are two different beasts.
The book is darker and more psychological. Elio may be crazy. The ending rips the bandaid off. It’s like “Endless Love”, or “The Talented Mr. Ridley” without the murders.
The movie eliminated the book’s epilogue and kept it very dreamlike and innocent. As you may have noticed, the movie attracted a huge audience of teenage girls and young women who are a little bit crazy. Had they kept the original ending, where they rip the bandaid off, it probably wouldn’t have had that effect. Minghella’s “Ripley”, which is a masterpiece, had a profound effect in almost every gay man who saw it, because the movie understood the darker aspects of queerness. As did “Moonlight” and “Brokeback Mountain”, two more masterpieces that, ironically, like Ripley, were made by straight men.
“CMBYN”, made by a gay man, is basically a “queer tourism” film for women.
That being said, there is some evidence that a darker ending had been filmed and was eliminated, probably after testing poorly (Guadagnino’s films almost always have tragic endings.)
Anyway back to the subject at hand, Hammer developed a close mentorship with Guadagnino and for some strange reason took his mistress (the one now accusing him of sexual abuse) to Italy to meet him. At this point, I believe Guadagnino learned about Hammer’s, um, dietary preferences. And that was how “Bones and All” came to be. The movie was announced just after the scandal broke, but the rights and optioning and getting Chalamet and Stuhlberg on board would have happened before the scandal became public. Which suggests they also knew, likely because Guadagnino told them.
Now, someone who would do something this underhanded (take a friend’s secret and turn it into a movie) would not have made such a maudlin film as “CMBYN”. So imo, a darker ending was filmed (probably Elio killing himself) and eliminated from the final cut. Look at the endings for all of Guadagnino’s films. “Call Me By Your Name” is the outlier.