The book could mean that it was a mission for John to perform. As he eats it, accepts his mission, it is sweet,the words are sweet to the ears of those who hearken to them, but as he performs his mission, speaks the words of this prophecy, it becomes bitter to him as people don't understand it or reject it outright. They will not repent of their wickedness, so it is upsetting to him, which is the bitterness in his belly.
Reply from Watchman Bob: Good insight. John's mission is to "write the words of this prophecy" to send to the seven congregations of Asia. And the little book which is sweet to the taste then turns sour in the belly represents the initial sweetness of the vengeance of the Lord on the wicked but the sourness of the terrible devastation of that vengeance.