Remus lupin, as a werewolf, had to show a great deal of bravery going into the full moon every month, he had to learn to be strong and unafraid early on because if he went through it all terrified and scared he never would have made it that far. He may have had other traits, but he'd already lived a life full of courage.
Sirius black, despite being ambitious and cunning and smart, and displaying a multitude of non-gryffindor traits, still went into Gryffindor because he had to display bravery and leadership in his home, taking punishments in place of regulus and standing up, was incredibly brave.
Regulus had bravery in him, we know this from the horcrux hunt. And while it definitely wasn't enough to get him in Gryffindor, he may have had more courage in him if Sirius didn't take his place so often.
Regulus was shielded from his parents abuse quite a lot and never had to developed as much of that braveness that Sirius did, arguably he got all his bravery after Sirius left, and he was subjected directly to more abuse than usual, deciding to then go leave for the cave.
And then you have people like James, who became a Gryffindor because leadership was naturally in his body, he never went through anything that forced him to be stronger, that was just how he is.
You have teddy lupin, who lived through the aftermath of the war and went into Hufflepuff because he was raised around a healing community, raised around people recovering and became kindhearted.
Hermione, who could very easily get into ravenclaw, got into Gryffindor because her moral compass and her need to do what's right was larger than her need for knowledge, we see this trait when she stands up to Neville in the sorcerer's stone.
So while, yes, your house is determined by your personality, and what you're like, you also should take into consideration that you may not know yourself as well as you think, you may have had events in the past that change what house you've been in, you may think it's obvious where you belong, but the small actions you make in the name of kindness, righteousness, wisdom or in the name of ambition, can swing your outcome one way or another.
It is always a possibility that you end up somewhere you didn't expect to end up.












