Bilbo cursed Gollum? I don’t remember that.
I misspoke. Frodo cursed Gollum. It happened while they were traversing the wilderness in order to enter Mordor (IIRC). Gollum was trying to get the ring, and Frodo told him that if he ever touched the ring again, he would die.
If it weren't for that curse, Gollum would not have fallen into Mount Doom at the end when he stole the ring. And Sauron would have recovered the ring.
I'll have to look for exactly where that happened, and hope the page numbers in my books match those in other editions.