If the service is extra good I might tip extra.
If the service is very bad (unreasonably slow, or staff forget or mix up the order in a significant way, or they are very rude), I tip 0%. Of course everyone can mess up things a little so it’s not like I immediately tip 0% just because of some minor thing. It has to be properly bad.
Also something I have learned from the Spanish is to always order something small and quick for the table even before we have decided what to eat. Then if it takes 40 minutes before the food comes it doesn’t matter that much compared to when you are starving for food. So this is a very neat trick that helps a lot to have a good experience even at slow places, and something I have started always doing.