Three people are known to have had problems with the sorting ceremony. They are Minerva McGonagall, Peter Pettigrew, and Harry Potter.
When it comes to Harry, the reason may have been a part of Voldemort’s soul that latched onto him the night the dark wizard tried to kill the boy.