Neither are a shock as such in terms of the money earned. For me, the 'shock' value would be in actually getting a Spider-Man film actually completed and out to production, and certainly one directed by Raimi, at that stage, untried in big-budget films and certainly in the genre, even though a huge Spidey fan.
Following Superman & Batman, during the pre-MCU days, he would have been seen as the next logical step to take, but the SFX needed to do justice had to wait and even in 2002, there was catch-up on that but look at the difference between SM 1 and 2, the leap is huge in the CGI development.
However, once you know a Spider-Man film was coming out, I'd have said it was a sure-fire hit, I was 27 at the time of release and it was that child's generation of Superman was to me in 1978.
Avengers was nailed on, was always gonna go big after the build up and by 2012, Marvel were very assured at making their films.