I keep the first frame a keyframe for all bones in their zero position, for situations like this.
Instead of rotating the problematic bones in situ, rotate them from zero in the reference key and then copy and paste (don't even need to set keyframe, so the reference stays perfect). Doing this usually helps, but in some situations it may not work.
If you're still having trouble, you can send me the model and I'll take a look.