People who stay in restaurants when they are clearly trying to close, why do you do it?

I don’t know the specific situation you’re discussing, but I think sometimes in social situations like this there can be an issue of people assuming that others are picking up on the social cues they’re sending and when they don’t react in a way you think is appropriate then it gets attributed to malice. This idea of “clearly they know i’m trying to close, but they’re staying here intentionally to spite me!”

Which is definitely possible, but what’s also possible is people being aloof and not reading the room very well. For example, I have ADHD and a lot of times I can be really bad at picking up on social cues if I’m very focused on something else.

Assuming it’s not against the rules, being more explicit by going up to the table that’s not leaving and just mentioning “hey by the way we’re closing shortly” could help ensure that the communication you’re trying to send is received instead of relying on the other person’s correct interpretation of social cues