I would focus on role playing with him and helping him learn how to negotiate when needed, listen when that is warranted (which is the majority of the time at this age) and defy in the few instances where that is reasonable.
I do tell my kids that adults sometimes ,though rarely, could ask you to do something you believe mom or dad may not approve of or just isn't safe. In those cases, it is okay to refuse to do that and ask repeatedly for your mom or dad to confirm whether this is okay or not. I can give you an example that happened in my life. One child was at a friend's to play. He refused to get into their pool because the mom wasn't going to be with them. She even told me after the fact she told them to go swim "while she got things done". He knew this was a big no from me, so refused to comply, which resulted in me being called to get him because she was "too busy" to watch the kids. It also ended him ever going to play there again, obviously. The only defense I can give her is that all the kids could touch the bottom, but this is still a big no from me and my child knew this, so he complied with me versus her, so essentially he was still following rules, just my rules.
Another child was picked up for a play date. He came back in the house a few minutes later very upset. He said he was told to ride in the car without any carseat. I had told this mom if she needed his booster it was in my unlocked car. Instead she told him it was a short drive and he didn't need it. He is a rule follower, so when he felt he couldn't get out of the argument, he told her he had to pee, and came in to tell me.
So I have taught my kids that if they do not feel safe about what they are being told, they do not have to comply. I think this is reasonable, especially given that I have seen justified cases where they have exerted their defiance.
That said, they are also told to what they are told unless it feels unsafe and if they do not like what they are told, comply in the meantime and wait for me or dad. In this case, it seems likely that you would be permitted to walk him around to look for his water bottle, so waiting would likely resolve all of it. So perhaps focus on telling him that if he absolutely disagrees with someone of authority, hold his tongue, do as asked and then wait to talk it through with you. If he had a point and you think maybe he could have been permitted to do something, then you can advocate for him, if not, you can help him understand the "why not".
I think what you tell him is that at school teachers worry about everyone, not just him or his interests, so they cannot let him do some of the things he wants to do because they cannot allow all the kids to just do whatever each kids wants to do. Then maybe do a little work too on social skills. Learning how to get along well with teachers and other authority figures can serve you very well in life. In my house we are silly and fun about it and call them "dramatic reenactments", and I let the kid choose who has what part, inform us of what we are reenacting, etc. Then we talk about what the right and wrong way is to handle that situation. Sometimes I get to be the defiant kid and they are in charge and I get to drive them crazy with my "but why" questions. ;)