There both correct ( very close in meaning) , but "sooner" carries a sense of "urgency and speed of something happening" more that "earlier" implies ; it's something that you wished had happened earlier than it actually happened./than you had expected
> You just paid someone to buy some food , and then your friends came to your house with a lot of food . Then it is better to say " I wished you had come sooner" than "earlier" to emphasis the fact that there was A time preference for something to happen > "earlier" is just a general perference of ANY time before .