Situation While Working Today... AITA?

Okay, so a situation happened at work today, and I’ve been reflecting on it. I thought that I was in the right initially, but after talking to a friend, they think I crossed a line. Now I’m second-guessing myself and could use some more input.

I was working the drive-thru window during peak, and I had a personal drink beside me (which nearly everyone at my location does while working DT). Suddenly, my shift leader came up, grabbed the drink, and said, “No personal drinks allowed; you could accidentally hand it out.” I pointed out that my name was on it in bright neon marker, so it was clear that it was my drink and wouldn’t get mixed up with an order. Plus, I was the one handing out the drinks, so it seemed obvious I wouldn’t accidentally give out my own. Despite that, the shift leader took the drink away, insisting I couldn’t have it.

At this point, I’d already been working for about 5 hours without a break, and I’d been understanding about not getting my lunch break, given how busy we were. But when the shift started being so picky about the rules, I figured, if we’re going to follow them so strictly, then why not follow the one about giving lunch breaks too? So I said, “Okay, well, if I can’t have my drink here, can I go on my lunch break and have it? I’m well past the 3.5-hour mark at this point” (which, as a minor, I am required to have a lunch break after that amount of time has surpassed in my state).

However, my shift leader shot that down, saying that they couldn't afford to put me on my lunch during peak... yet they also still insisted that I couldn’t have my drink? So, after a bit more back and forth, I was kind of at my breaking point, especially since they were giving me attitude and a rude tone from the get-go, and I just calmly took off my apron and walked out about 40 minutes before my shift was supposed to end.

Then, I talked to a friend who works at another Starbucks about it, and they said I was in the wrong for walking out like that because it affected the whole team, not just my shift leader, especially during peak. I get that, but at the same time, I was so upset that I didn't think I could keep pushing through. I just find it ironic, "unlimited free drinks" during shifts, but you can't use it while working, and you can't have your lunch breaks to use it either! lmao. Anyway, sorry for the long-winded post, was really hoping for some insight and advice.

-
TL;DR: I was working the drive-thru during a busy shift and had a personal drink with my name on it. My shift leader took it away, saying no personal drinks were allowed in a rude tone. I’d been working for 5 hours without a lunch break (as required by law after 3.5 hours for minors) and asked if I could take my break to have the drink. They denied my break request, but still wouldn’t let me have the drink. Frustrated, I walked out 40 minutes early. A friend thinks I was wrong for leaving during peak hours, but I felt like I was being micromanaged and pushed to my breaking point. Am I in the wrong?

-

EDIT: I see a lot of people talking about health code violations, my store does not truly care about those. Literally this same shift we were working with a partner who was under the weather... coughing, sniffling, sneezing, wearing a face mask and all. I understand that this does not justify me having a personal drink on the floor, but my problem really lies with the management "picking and choosing" what rules to follow and then getting upset when the inconsistencies are pointed out.

I have also seen people saying that my response was over the top, which I can also understand, though I was already extremely stressed as peak had been going on for well over an hour at that point and the whole shift had generally been extremely stressful/busy. The request itself was also not my main issue and I'm sure I would've happily complied with it for it had not been the way that the SSv had treated me. I'm fortunate enough to not have to rely on Sbux benefits and I definitely do not get paid enough to be disrespected by a co-worker like that, so I just felt like staying for the rest of the shift was not worth sacrificing my self-respect and mental health tbh. I'm not quite sure if i'll get fired for this or not but either way I am probably going to just get another job elsewhere

Also-much appreciation for the clarification regarding health code and for the tips on how I should better handle this should something similar happen in the future