The ending was in the book.
It probably had more to do with the success of Animal House (even casting one of the performers). And it wasn’t a lone entry in this competition.
The Baby Boomers were big market and mid-50s-mid-60s nostalgia was in bloom.
Big Wednesday trailer
https://www.youtube.com/watch?v=5hFH3q5bz1Q
Cooley High trailer
https://www.youtube.com/watch?v=zqWDOyESFTY
My favorite movie of that era is still “Hollywood Knights”.
The book version of “The Wanderers” was more explicitly racist by the standards of today, but keep in mind that Price was writing about the mileau he observed growing up in the Bronx at that time, as one of the few Jewish kids in a housing project with a large Italian and black population.