The bill was £25 and not £27. (this is where you are getting confused or fishing)
3 x £9 is not £25. (cost of the bill) To make it £27 (£10 x 3 minus the 3 x £1 returned to the customers) the £2 between £25 & £27 must be the £2 tip the waiter gets...