He was probably, over-tired and over-stimulated and/or hungry....or was feeling all of those things, at the same time.
The party, was at night time.
Over-tired/over-stimulated kids/babies, scream/tantrum/have meltdowns sometimes, in order to 'shut-out' all that overly stimulating things. They don't have succinct, ways to communicate nor even know their own feelings, yet. And at this age and even in 3 year olds, they do not have fully developed "impulse control" either, yet.
As you said, he fell asleep, once you took him away from the party, for a walk in the stroller.
That is your answer.
He had had, too much and his patience was nil. By that time.
He's 19 months old.
They cannot 'say' how they feel, or what they need, or if their patience is nil, or what they want. Hence, they scream/cry or tantrum. They don't even have the words to explicitly 'say' how they are feeling.
Know your child's cues.
When my kids were very young, I did not take them to parties at night, unless I had to. And I made sure they had a nap, during the day, before the party at night.
Then, at the party, we would not stay all night. When my kids, that age, were tired, as I knew their cues, we left the party.