When Snape turns up in the Shrieking Shack, he has this to say to the assembled party:
Snape was slightly breathless, but his face was full of suppressed
triumph. “You’re wondering, perhaps, how I knew you were here?” he said, his eyes glittering. “I’ve just been to your office, Lupin. You forgot
to take your potion tonight, so I took a gobletful along. And very lucky
I did... lucky for me, I mean. Lying on your desk was a certain map. One glance at it told me all I needed to know. I saw you running along this passageway and out of sight.”
It sounds like Snape found the goblet sitting on his desk, about to be drunk, and Lupin was also inspecting the map at the same time. (If the map was inactive, it’s unlikely Snape would have been able to activate it.)
Later, Lupin explains the Wolfsbane Potion to Hermione:
“The potion that Professor Snape has been making for me is a very recent discovery. It makes me safe, you see. As long as I take it in the week, preceding the full moon, I keep my mind when I transform… I’m able to curl up in my office, a harmless wolf, and wait for the moon to wane again.”
In the excitement and uproar of seeing Sirius and Peter on the map (especially given that he thought Peter was dead), he probably left the potion (and the map) as he want to assist Sirius and/or Harry, Ron and Hermione.