i saw a post complaining that sirius black was always portrayed as an overexcited 12 years old girl when he was at hogwarts, but i feel like it makes perfect sense with his past.
he was never allowed to have fun and do what he wanted at his home. when he was sorted in gryffindor, he was more free that he ever been. i think he would want to enjoy this freedom and do whatever he wants, and that includes acting like a child sometimes since he never got the chance to be one before.
also this could be his way to hide the abusive behaviour of his parents to his friends. maybe he even tried to copy the behaviour of james, the “happy and normal kid” in the group. this attitude could be both his way to hide and to heal his problems.
and when he acted like his dark and depressed self, it was usually because he couldn’t pretend anymore. it was the moments he both needed and rejected his friends.
and that is what we clearly see in the ootp : he can act like a child or a teen, mistaking harry for james, insulting him “you’re not as much like your father than i thought” ( approximative quote ).
my point is that he wasn’t a child : he had a serious bipolar disorder and his childish behaviour occured during his manic phases, leading him to be careless and make impulsive decisions.
( please keep in mind that i am not a psychiatrist and do not experience bipolar disorder. if i said anything offensive, please message me and will immediatly correct it )