At face value non-partnered restaurants dont lose money, they simply get more customers (essentially, getting some of the services that partnered restaurants get, but for free since partnered restaurants pay fees for each order that goes through the platform)
However, in truth they pay damage in reputation. If the delivery company delivers food slow, or lets it get cold, then the customer will blame the restaurant. On top of that, unpartnered restaurants will naturally get slower delivery times because the order flow involves grubhub delivery people walking in and placing an order (or calling in), whereas partnered restaurants get point of sale systems integrated with grubhub's backend. They get less accurate delivery time estimations. They might pay a much higher delivery fee or service fee. All things add up to a worse customer experience.