How to get toddler to understand no

I have a 2 1/2 year old. When I tell her no as in she’s not allowed to do something, she understands. However, when she says no.. it’s like she doesn’t understand.

For example, she goes into time out and after a few minutes I ask if she’s done and she will say “no.” So I say okay and walk away. That goes on for a long time until I finally get tired of it and let her out.

Or today, she handed me her cup and said she was thirsty. So I filled it up with water and went to hand it back to her and she said no and wouldn’t take it. So I put it on the counter. She screamed for 20 minutes but when I offered it to her again, she said no.

Right now she’s crying because she said she wanted an apple and I tried to give it to her and she kept saying no so I told her then she’s not getting one.