This happens to me quite often also!
I use an IPhone 6 and it's clearly overheating. I don't know if this is the problem.
My internet connection is quite good (I live in Japan and the 4G here is very nice).
The raids usually have a lot of people! Tyranitars often have 12-15 people fighting. I think this can be an issue because I noticed that in more crowded areas where people play more, the game crashes more. But it's just my impression!
I'm thinking about changing my phone to see if it helps...anyone have a good suggestion?