I don't get why you're adding the two gold pieces that the innkeeper is keeping to the final amount. The 27 gp that the adventurers paid already include those 2 gp. 25 gp for the room + 2 gp for the trouble = 27 gp, which divided by 3 is the 9 gp that each paid. There's no missing coin because the amount now has changed to 27, not to 29.

In fact, if the total amount was now 29, what we should figure out is where those two extra coins came from.