One of the problems that leads to hands slipping off to the side is that it's hard to roll straight over the top of your head on beam. So your head will naturally tilt to one side or the other and lead you to have trouble going straight over the top. Make sure you are truly in a round ball as you roll with your head tucked as much as possible. Another thing is that this skill is one of those things that just doesn't work slowly. If you roll too slowly, you will definitely go off to one side or the other. It's hard to be aggressive about a new skill, so I'd suggest putting a 4-inch mat over the beam while you're working on it so that you can be aggressive. You can move down to a sting mat and then a small pad as you get more confident. If a coach is available a spot can also help.
Another thing to help with building up to a full back extension is that you can try just doing a straight backward roll in a tucked position, landing in a squat. That might help with hand placement/staying straight since you wouldn't have to worry about the back extension part.
Also - it sucks to feel like you have to learn a skill quickly, especially when an injury is involved! Sometimes certain skills just don't come as fast as we'd like them to. I hope you can get this skill down and compete it, but try not to feel too much pressure. If you have to leave it out of a routine or scratch beam at a meet, it's no big deal. You can do your best beam routine at the next meet.