Peter Quill is very much a big kid – and not necessarily in an endearing way. He was kidnapped from Earth as a child, grew up living amongst a bunch of space thieves, and became a criminal who just wants to have a good time. Meeting the other members of what will be the Guardians of the Galaxy does make him start thinking about more than himself and try to do some good, but he’s still very hot-headed and immature.
It makes sense that he is immature as he’s grown up in an environment where there was the threat of death almost every day, so while he’s learnt to be smart and resourceful, he never had a childhood and the chance to be a kid. Quill’s very sarcastic and brash, but he’s also proved himself to be a good leader, that can think on his feet.
Quill cares deeply about those he loves so when he’s told that someone he loves is dead, his emotions get the better of him, causing him to lose control and lash out. That scene in Infinity War is tough to watch for a lot of reasons but I don’t hate it, or Quill, like some other people do. That’s because Quill’s actions are very much in character because when he learnt of the true reason his mother died, he acted exactly the same way.